@olonjs/core 1.0.85 → 1.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,4 @@
1
- (function(Ce,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react"),require("react-router-dom"),require("zod"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-router-dom","zod","react-dom"],N):(Ce=typeof globalThis<"u"?globalThis:Ce||self,N(Ce.OlonJsCore={},Ce.React,Ce.ReactRouterDOM,Ce.z,Ce.ReactDOM))})(this,(function(Ce,N,Ye,Pe,mt){"use strict";function Ci(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const E=Ci(N),Wr=Ci(mt);function Ei(e,t){return t.header!=null&&e["global-header"]!==!1}const Ae={UPDATE_DRAFTS:"jsonpages:update-drafts",SYNC_SELECTION:"jsonpages:sync-selection",REQUEST_CLEAN_HTML:"jsonpages:request-clean-html",SEND_CLEAN_HTML:"jsonpages:send-clean-html",SECTION_SELECT:"jsonpages:section-select",INLINE_FIELD_UPDATE:"jsonpages:inline-field-update",INLINE_FLUSHED:"jsonpages:inline-flushed",REQUEST_SCROLL_TO_SECTION:"jsonpages:request-scroll-to-section",REQUEST_INLINE_FLUSH:"jsonpages:request-inline-flush",ACTIVE_SECTION_CHANGED:"jsonpages:active-section-changed",STAGE_READY:"jsonpages:stage-ready"};var gt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Hr(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var to={exports:{}};/*!
2
-
3
- JSZip v3.10.1 - A JavaScript class for generating and reading zip files
4
- <http://stuartk.com/jszip>
5
-
6
- (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
7
- Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
8
-
9
- JSZip uses the library pako released under the MIT license :
10
- https://github.com/nodeca/pako/blob/main/LICENSE
11
- */var Ni;function jc(){return Ni||(Ni=1,(function(e,t){(function(r){e.exports=r()})(function(){return(function r(n,o,i){function s(c,d){if(!o[c]){if(!n[c]){var f=typeof Hr=="function"&&Hr;if(!d&&f)return f(c,!0);if(a)return a(c,!0);var m=new Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m}var p=o[c]={exports:{}};n[c][0].call(p.exports,function(w){var u=n[c][1][w];return s(u||w)},p,p.exports,r,n,o,i)}return o[c].exports}for(var a=typeof Hr=="function"&&Hr,l=0;l<i.length;l++)s(i[l]);return s})({1:[function(r,n,o){var i=r("./utils"),s=r("./support"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";o.encode=function(l){for(var c,d,f,m,p,w,u,g=[],b=0,v=l.length,k=v,_=i.getTypeOf(l)!=="string";b<l.length;)k=v-b,f=_?(c=l[b++],d=b<v?l[b++]:0,b<v?l[b++]:0):(c=l.charCodeAt(b++),d=b<v?l.charCodeAt(b++):0,b<v?l.charCodeAt(b++):0),m=c>>2,p=(3&c)<<4|d>>4,w=1<k?(15&d)<<2|f>>6:64,u=2<k?63&f:64,g.push(a.charAt(m)+a.charAt(p)+a.charAt(w)+a.charAt(u));return g.join("")},o.decode=function(l){var c,d,f,m,p,w,u=0,g=0,b="data:";if(l.substr(0,b.length)===b)throw new Error("Invalid base64 input, it looks like a data url.");var v,k=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===a.charAt(64)&&k--,l.charAt(l.length-2)===a.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(v=s.uint8array?new Uint8Array(0|k):new Array(0|k);u<l.length;)c=a.indexOf(l.charAt(u++))<<2|(m=a.indexOf(l.charAt(u++)))>>4,d=(15&m)<<4|(p=a.indexOf(l.charAt(u++)))>>2,f=(3&p)<<6|(w=a.indexOf(l.charAt(u++))),v[g++]=c,p!==64&&(v[g++]=d),w!==64&&(v[g++]=f);return v}},{"./support":30,"./utils":32}],2:[function(r,n,o){var i=r("./external"),s=r("./stream/DataWorker"),a=r("./stream/Crc32Probe"),l=r("./stream/DataLengthProbe");function c(d,f,m,p,w){this.compressedSize=d,this.uncompressedSize=f,this.crc32=m,this.compression=p,this.compressedContent=w}c.prototype={getContentWorker:function(){var d=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),f=this;return d.on("end",function(){if(this.streamInfo.data_length!==f.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(d,f,m){return d.pipe(new a).pipe(new l("uncompressedSize")).pipe(f.compressWorker(m)).pipe(new l("compressedSize")).withStreamInfo("compression",f)},n.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,n,o){var i=r("./stream/GenericWorker");o.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},o.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,n,o){var i=r("./utils"),s=(function(){for(var a,l=[],c=0;c<256;c++){a=c;for(var d=0;d<8;d++)a=1&a?3988292384^a>>>1:a>>>1;l[c]=a}return l})();n.exports=function(a,l){return a!==void 0&&a.length?i.getTypeOf(a)!=="string"?(function(c,d,f,m){var p=s,w=m+f;c^=-1;for(var u=m;u<w;u++)c=c>>>8^p[255&(c^d[u])];return-1^c})(0|l,a,a.length,0):(function(c,d,f,m){var p=s,w=m+f;c^=-1;for(var u=m;u<w;u++)c=c>>>8^p[255&(c^d.charCodeAt(u))];return-1^c})(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(r,n,o){o.base64=!1,o.binary=!1,o.dir=!1,o.createFolders=!0,o.date=null,o.compression=null,o.compressionOptions=null,o.comment=null,o.unixPermissions=null,o.dosPermissions=null},{}],6:[function(r,n,o){var i=null;i=typeof Promise<"u"?Promise:r("lie"),n.exports={Promise:i}},{lie:37}],7:[function(r,n,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=r("pako"),a=r("./utils"),l=r("./stream/GenericWorker"),c=i?"uint8array":"array";function d(f,m){l.call(this,"FlateWorker/"+f),this._pako=null,this._pakoAction=f,this._pakoOptions=m,this.meta={}}o.magic="\b\0",a.inherits(d,l),d.prototype.processChunk=function(f){this.meta=f.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(c,f.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var f=this;this._pako.onData=function(m){f.push({data:m,meta:f.meta})}},o.compressWorker=function(f){return new d("Deflate",f)},o.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,n,o){function i(p,w){var u,g="";for(u=0;u<w;u++)g+=String.fromCharCode(255&p),p>>>=8;return g}function s(p,w,u,g,b,v){var k,_,S=p.file,O=p.compression,z=v!==c.utf8encode,I=a.transformTo("string",v(S.name)),D=a.transformTo("string",c.utf8encode(S.name)),U=S.comment,H=a.transformTo("string",v(U)),C=a.transformTo("string",c.utf8encode(U)),M=D.length!==S.name.length,y=C.length!==U.length,L="",Q="",F="",$=S.dir,V=S.date,re={crc32:0,compressedSize:0,uncompressedSize:0};w&&!u||(re.crc32=p.crc32,re.compressedSize=p.compressedSize,re.uncompressedSize=p.uncompressedSize);var A=0;w&&(A|=8),z||!M&&!y||(A|=2048);var P=0,J=0;$&&(P|=16),b==="UNIX"?(J=798,P|=(function(te,ce){var q=te;return te||(q=ce?16893:33204),(65535&q)<<16})(S.unixPermissions,$)):(J=20,P|=(function(te){return 63&(te||0)})(S.dosPermissions)),k=V.getUTCHours(),k<<=6,k|=V.getUTCMinutes(),k<<=5,k|=V.getUTCSeconds()/2,_=V.getUTCFullYear()-1980,_<<=4,_|=V.getUTCMonth()+1,_<<=5,_|=V.getUTCDate(),M&&(Q=i(1,1)+i(d(I),4)+D,L+="up"+i(Q.length,2)+Q),y&&(F=i(1,1)+i(d(H),4)+C,L+="uc"+i(F.length,2)+F);var G="";return G+=`
12
- \0`,G+=i(A,2),G+=O.magic,G+=i(k,2),G+=i(_,2),G+=i(re.crc32,4),G+=i(re.compressedSize,4),G+=i(re.uncompressedSize,4),G+=i(I.length,2),G+=i(L.length,2),{fileRecord:f.LOCAL_FILE_HEADER+G+I+L,dirRecord:f.CENTRAL_FILE_HEADER+i(J,2)+G+i(H.length,2)+"\0\0\0\0"+i(P,4)+i(g,4)+I+L+H}}var a=r("../utils"),l=r("../stream/GenericWorker"),c=r("../utf8"),d=r("../crc32"),f=r("../signature");function m(p,w,u,g){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=w,this.zipPlatform=u,this.encodeFileName=g,this.streamFiles=p,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(m,l),m.prototype.push=function(p){var w=p.meta.percent||0,u=this.entriesCount,g=this._sources.length;this.accumulate?this.contentBuffer.push(p):(this.bytesWritten+=p.data.length,l.prototype.push.call(this,{data:p.data,meta:{currentFile:this.currentFile,percent:u?(w+100*(u-g-1))/u:100}}))},m.prototype.openedSource=function(p){this.currentSourceOffset=this.bytesWritten,this.currentFile=p.file.name;var w=this.streamFiles&&!p.file.dir;if(w){var u=s(p,w,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:u.fileRecord,meta:{percent:0}})}else this.accumulate=!0},m.prototype.closedSource=function(p){this.accumulate=!1;var w=this.streamFiles&&!p.file.dir,u=s(p,w,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(u.dirRecord),w)this.push({data:(function(g){return f.DATA_DESCRIPTOR+i(g.crc32,4)+i(g.compressedSize,4)+i(g.uncompressedSize,4)})(p),meta:{percent:100}});else for(this.push({data:u.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},m.prototype.flush=function(){for(var p=this.bytesWritten,w=0;w<this.dirRecords.length;w++)this.push({data:this.dirRecords[w],meta:{percent:100}});var u=this.bytesWritten-p,g=(function(b,v,k,_,S){var O=a.transformTo("string",S(_));return f.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(b,2)+i(b,2)+i(v,4)+i(k,4)+i(O.length,2)+O})(this.dirRecords.length,u,p,this.zipComment,this.encodeFileName);this.push({data:g,meta:{percent:100}})},m.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},m.prototype.registerPrevious=function(p){this._sources.push(p);var w=this;return p.on("data",function(u){w.processChunk(u)}),p.on("end",function(){w.closedSource(w.previous.streamInfo),w._sources.length?w.prepareNextSource():w.end()}),p.on("error",function(u){w.error(u)}),this},m.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},m.prototype.error=function(p){var w=this._sources;if(!l.prototype.error.call(this,p))return!1;for(var u=0;u<w.length;u++)try{w[u].error(p)}catch{}return!0},m.prototype.lock=function(){l.prototype.lock.call(this);for(var p=this._sources,w=0;w<p.length;w++)p[w].lock()},n.exports=m},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(r,n,o){var i=r("../compressions"),s=r("./ZipFileWorker");o.generateWorker=function(a,l,c){var d=new s(l.streamFiles,c,l.platform,l.encodeFileName),f=0;try{a.forEach(function(m,p){f++;var w=(function(v,k){var _=v||k,S=i[_];if(!S)throw new Error(_+" is not a valid compression method !");return S})(p.options.compression,l.compression),u=p.options.compressionOptions||l.compressionOptions||{},g=p.dir,b=p.date;p._compressWorker(w,u).withStreamInfo("file",{name:m,dir:g,date:b,comment:p.comment||"",unixPermissions:p.unixPermissions,dosPermissions:p.dosPermissions}).pipe(d)}),d.entriesCount=f}catch(m){d.error(m)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(r,n,o){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new i;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}(i.prototype=r("./object")).loadAsync=r("./load"),i.support=r("./support"),i.defaults=r("./defaults"),i.version="3.10.1",i.loadAsync=function(s,a){return new i().loadAsync(s,a)},i.external=r("./external"),n.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(r,n,o){var i=r("./utils"),s=r("./external"),a=r("./utf8"),l=r("./zipEntries"),c=r("./stream/Crc32Probe"),d=r("./nodejsUtils");function f(m){return new s.Promise(function(p,w){var u=m.decompressed.getContentWorker().pipe(new c);u.on("error",function(g){w(g)}).on("end",function(){u.streamInfo.crc32!==m.decompressed.crc32?w(new Error("Corrupted zip : CRC32 mismatch")):p()}).resume()})}n.exports=function(m,p){var w=this;return p=i.extend(p||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),d.isNode&&d.isStream(m)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",m,!0,p.optimizedBinaryString,p.base64).then(function(u){var g=new l(p);return g.load(u),g}).then(function(u){var g=[s.Promise.resolve(u)],b=u.files;if(p.checkCRC32)for(var v=0;v<b.length;v++)g.push(f(b[v]));return s.Promise.all(g)}).then(function(u){for(var g=u.shift(),b=g.files,v=0;v<b.length;v++){var k=b[v],_=k.fileNameStr,S=i.resolve(k.fileNameStr);w.file(S,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:p.createFolders}),k.dir||(w.file(S).unsafeOriginalName=_)}return g.zipComment.length&&(w.comment=g.zipComment),w})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(r,n,o){var i=r("../utils"),s=r("../stream/GenericWorker");function a(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}i.inherits(a,s),a.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(d){c.push({data:d,meta:{percent:0}})}).on("error",function(d){c.isPaused?this.generatedError=d:c.error(d)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},a.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},n.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(r,n,o){var i=r("readable-stream").Readable;function s(a,l,c){i.call(this,l),this._helper=a;var d=this;a.on("data",function(f,m){d.push(f)||d._helper.pause(),c&&c(m)}).on("error",function(f){d.emit("error",f)}).on("end",function(){d.push(null)})}r("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},n.exports=s},{"../utils":32,"readable-stream":16}],14:[function(r,n,o){n.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,s)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var s=new Buffer(i);return s.fill(0),s},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(r,n,o){function i(S,O,z){var I,D=a.getTypeOf(O),U=a.extend(z||{},d);U.date=U.date||new Date,U.compression!==null&&(U.compression=U.compression.toUpperCase()),typeof U.unixPermissions=="string"&&(U.unixPermissions=parseInt(U.unixPermissions,8)),U.unixPermissions&&16384&U.unixPermissions&&(U.dir=!0),U.dosPermissions&&16&U.dosPermissions&&(U.dir=!0),U.dir&&(S=b(S)),U.createFolders&&(I=g(S))&&v.call(this,I,!0);var H=D==="string"&&U.binary===!1&&U.base64===!1;z&&z.binary!==void 0||(U.binary=!H),(O instanceof f&&O.uncompressedSize===0||U.dir||!O||O.length===0)&&(U.base64=!1,U.binary=!0,O="",U.compression="STORE",D="string");var C=null;C=O instanceof f||O instanceof l?O:w.isNode&&w.isStream(O)?new u(S,O):a.prepareContent(S,O,U.binary,U.optimizedBinaryString,U.base64);var M=new m(S,C,U);this.files[S]=M}var s=r("./utf8"),a=r("./utils"),l=r("./stream/GenericWorker"),c=r("./stream/StreamHelper"),d=r("./defaults"),f=r("./compressedObject"),m=r("./zipObject"),p=r("./generate"),w=r("./nodejsUtils"),u=r("./nodejs/NodejsStreamInputAdapter"),g=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var O=S.lastIndexOf("/");return 0<O?S.substring(0,O):""},b=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},v=function(S,O){return O=O!==void 0?O:d.createFolders,S=b(S),this.files[S]||i.call(this,S,null,{dir:!0,createFolders:O}),this.files[S]};function k(S){return Object.prototype.toString.call(S)==="[object RegExp]"}var _={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(S){var O,z,I;for(O in this.files)I=this.files[O],(z=O.slice(this.root.length,O.length))&&O.slice(0,this.root.length)===this.root&&S(z,I)},filter:function(S){var O=[];return this.forEach(function(z,I){S(z,I)&&O.push(I)}),O},file:function(S,O,z){if(arguments.length!==1)return S=this.root+S,i.call(this,S,O,z),this;if(k(S)){var I=S;return this.filter(function(U,H){return!H.dir&&I.test(U)})}var D=this.files[this.root+S];return D&&!D.dir?D:null},folder:function(S){if(!S)return this;if(k(S))return this.filter(function(D,U){return U.dir&&S.test(D)});var O=this.root+S,z=v.call(this,O),I=this.clone();return I.root=z.name,I},remove:function(S){S=this.root+S;var O=this.files[S];if(O||(S.slice(-1)!=="/"&&(S+="/"),O=this.files[S]),O&&!O.dir)delete this.files[S];else for(var z=this.filter(function(D,U){return U.name.slice(0,S.length)===S}),I=0;I<z.length;I++)delete this.files[z[I].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var O,z={};try{if((z=a.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=z.type.toLowerCase(),z.compression=z.compression.toUpperCase(),z.type==="binarystring"&&(z.type="string"),!z.type)throw new Error("No output type specified.");a.checkSupport(z.type),z.platform!=="darwin"&&z.platform!=="freebsd"&&z.platform!=="linux"&&z.platform!=="sunos"||(z.platform="UNIX"),z.platform==="win32"&&(z.platform="DOS");var I=z.comment||this.comment||"";O=p.generateWorker(this,z,I)}catch(D){(O=new l("error")).error(D)}return new c(O,z.type||"string",z.mimeType)},generateAsync:function(S,O){return this.generateInternalStream(S).accumulate(O)},generateNodeStream:function(S,O){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(O)}};n.exports=_},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(r,n,o){n.exports=r("stream")},{stream:void 0}],17:[function(r,n,o){var i=r("./DataReader");function s(a){i.call(this,a);for(var l=0;l<this.data.length;l++)a[l]=255&a[l]}r("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data[this.zero+a]},s.prototype.lastIndexOfSignature=function(a){for(var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),f=a.charCodeAt(3),m=this.length-4;0<=m;--m)if(this.data[m]===l&&this.data[m+1]===c&&this.data[m+2]===d&&this.data[m+3]===f)return m-this.zero;return-1},s.prototype.readAndCheckSignature=function(a){var l=a.charCodeAt(0),c=a.charCodeAt(1),d=a.charCodeAt(2),f=a.charCodeAt(3),m=this.readData(4);return l===m[0]&&c===m[1]&&d===m[2]&&f===m[3]},s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],18:[function(r,n,o){var i=r("../utils");function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var l,c=0;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=a,c},readString:function(a){return i.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=s},{"../utils":32}],19:[function(r,n,o){var i=r("./Uint8ArrayReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,n,o){var i=r("./DataReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},s.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},s.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},s.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./DataReader":18}],21:[function(r,n,o){var i=r("./ArrayReader");function s(a){i.call(this,a)}r("../utils").inherits(s,i),s.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(r,n,o){var i=r("../utils"),s=r("../support"),a=r("./ArrayReader"),l=r("./StringReader"),c=r("./NodeBufferReader"),d=r("./Uint8ArrayReader");n.exports=function(f){var m=i.getTypeOf(f);return i.checkSupport(m),m!=="string"||s.uint8array?m==="nodebuffer"?new c(f):s.uint8array?new d(i.transformTo("uint8array",f)):new a(i.transformTo("array",f)):new l(f)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,n,o){o.LOCAL_FILE_HEADER="PK",o.CENTRAL_FILE_HEADER="PK",o.CENTRAL_DIRECTORY_END="PK",o.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",o.ZIP64_CENTRAL_DIRECTORY_END="PK",o.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,n,o){var i=r("./GenericWorker"),s=r("../utils");function a(l){i.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(a,i),a.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(r,n,o){var i=r("./GenericWorker"),s=r("../crc32");function a(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(a,i),a.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,n,o){var i=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}i.inherits(a,s),a.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(r,n,o){var i=r("../utils"),s=r("./GenericWorker");function a(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){c.dataIsReady=!0,c.data=d,c.max=d&&d.length||0,c.type=i.getTypeOf(d),c.isPaused||c._tickAndRepeat()},function(d){c.error(d)})}i.inherits(a,s),a.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(r,n,o){function i(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(l){a.processChunk(l)}),s.on("end",function(){a.end()}),s.on("error",function(l){a.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},n.exports=i},{}],29:[function(r,n,o){var i=r("../utils"),s=r("./ConvertWorker"),a=r("./GenericWorker"),l=r("../base64"),c=r("../support"),d=r("../external"),f=null;if(c.nodestream)try{f=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function m(w,u){return new d.Promise(function(g,b){var v=[],k=w._internalType,_=w._outputType,S=w._mimeType;w.on("data",function(O,z){v.push(O),u&&u(z)}).on("error",function(O){v=[],b(O)}).on("end",function(){try{var O=(function(z,I,D){switch(z){case"blob":return i.newBlob(i.transformTo("arraybuffer",I),D);case"base64":return l.encode(I);default:return i.transformTo(z,I)}})(_,(function(z,I){var D,U=0,H=null,C=0;for(D=0;D<I.length;D++)C+=I[D].length;switch(z){case"string":return I.join("");case"array":return Array.prototype.concat.apply([],I);case"uint8array":for(H=new Uint8Array(C),D=0;D<I.length;D++)H.set(I[D],U),U+=I[D].length;return H;case"nodebuffer":return Buffer.concat(I);default:throw new Error("concat : unsupported type '"+z+"'")}})(k,v),S);g(O)}catch(z){b(z)}v=[]}).resume()})}function p(w,u,g){var b=u;switch(u){case"blob":case"arraybuffer":b="uint8array";break;case"base64":b="string"}try{this._internalType=b,this._outputType=u,this._mimeType=g,i.checkSupport(b),this._worker=w.pipe(new s(b)),w.lock()}catch(v){this._worker=new a("error"),this._worker.error(v)}}p.prototype={accumulate:function(w){return m(this,w)},on:function(w,u){var g=this;return w==="data"?this._worker.on(w,function(b){u.call(g,b.data,b.meta)}):this._worker.on(w,function(){i.delay(u,arguments,g)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(w){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new f(this,{objectMode:this._outputType!=="nodebuffer"},w)}},n.exports=p},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(r,n,o){if(o.base64=!0,o.array=!0,o.string=!0,o.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",o.nodebuffer=typeof Buffer<"u",o.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")o.blob=!1;else{var i=new ArrayBuffer(0);try{o.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),o.blob=s.getBlob("application/zip").size===0}catch{o.blob=!1}}}try{o.nodestream=!!r("readable-stream").Readable}catch{o.nodestream=!1}},{"readable-stream":16}],31:[function(r,n,o){for(var i=r("./utils"),s=r("./support"),a=r("./nodejsUtils"),l=r("./stream/GenericWorker"),c=new Array(256),d=0;d<256;d++)c[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;c[254]=c[254]=1;function f(){l.call(this,"utf-8 decode"),this.leftOver=null}function m(){l.call(this,"utf-8 encode")}o.utf8encode=function(p){return s.nodebuffer?a.newBufferFrom(p,"utf-8"):(function(w){var u,g,b,v,k,_=w.length,S=0;for(v=0;v<_;v++)(64512&(g=w.charCodeAt(v)))==55296&&v+1<_&&(64512&(b=w.charCodeAt(v+1)))==56320&&(g=65536+(g-55296<<10)+(b-56320),v++),S+=g<128?1:g<2048?2:g<65536?3:4;for(u=s.uint8array?new Uint8Array(S):new Array(S),v=k=0;k<S;v++)(64512&(g=w.charCodeAt(v)))==55296&&v+1<_&&(64512&(b=w.charCodeAt(v+1)))==56320&&(g=65536+(g-55296<<10)+(b-56320),v++),g<128?u[k++]=g:(g<2048?u[k++]=192|g>>>6:(g<65536?u[k++]=224|g>>>12:(u[k++]=240|g>>>18,u[k++]=128|g>>>12&63),u[k++]=128|g>>>6&63),u[k++]=128|63&g);return u})(p)},o.utf8decode=function(p){return s.nodebuffer?i.transformTo("nodebuffer",p).toString("utf-8"):(function(w){var u,g,b,v,k=w.length,_=new Array(2*k);for(u=g=0;u<k;)if((b=w[u++])<128)_[g++]=b;else if(4<(v=c[b]))_[g++]=65533,u+=v-1;else{for(b&=v===2?31:v===3?15:7;1<v&&u<k;)b=b<<6|63&w[u++],v--;1<v?_[g++]=65533:b<65536?_[g++]=b:(b-=65536,_[g++]=55296|b>>10&1023,_[g++]=56320|1023&b)}return _.length!==g&&(_.subarray?_=_.subarray(0,g):_.length=g),i.applyFromCharCode(_)})(p=i.transformTo(s.uint8array?"uint8array":"array",p))},i.inherits(f,l),f.prototype.processChunk=function(p){var w=i.transformTo(s.uint8array?"uint8array":"array",p.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var u=w;(w=new Uint8Array(u.length+this.leftOver.length)).set(this.leftOver,0),w.set(u,this.leftOver.length)}else w=this.leftOver.concat(w);this.leftOver=null}var g=(function(v,k){var _;for((k=k||v.length)>v.length&&(k=v.length),_=k-1;0<=_&&(192&v[_])==128;)_--;return _<0||_===0?k:_+c[v[_]]>k?_:k})(w),b=w;g!==w.length&&(s.uint8array?(b=w.subarray(0,g),this.leftOver=w.subarray(g,w.length)):(b=w.slice(0,g),this.leftOver=w.slice(g,w.length))),this.push({data:o.utf8decode(b),meta:p.meta})},f.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=f,i.inherits(m,l),m.prototype.processChunk=function(p){this.push({data:o.utf8encode(p.data),meta:p.meta})},o.Utf8EncodeWorker=m},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,n,o){var i=r("./support"),s=r("./base64"),a=r("./nodejsUtils"),l=r("./external");function c(u){return u}function d(u,g){for(var b=0;b<u.length;++b)g[b]=255&u.charCodeAt(b);return g}r("setimmediate"),o.newBlob=function(u,g){o.checkSupport("blob");try{return new Blob([u],{type:g})}catch{try{var b=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return b.append(u),b.getBlob(g)}catch{throw new Error("Bug : can't construct the Blob.")}}};var f={stringifyByChunk:function(u,g,b){var v=[],k=0,_=u.length;if(_<=b)return String.fromCharCode.apply(null,u);for(;k<_;)g==="array"||g==="nodebuffer"?v.push(String.fromCharCode.apply(null,u.slice(k,Math.min(k+b,_)))):v.push(String.fromCharCode.apply(null,u.subarray(k,Math.min(k+b,_)))),k+=b;return v.join("")},stringifyByChar:function(u){for(var g="",b=0;b<u.length;b++)g+=String.fromCharCode(u[b]);return g},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}})()}};function m(u){var g=65536,b=o.getTypeOf(u),v=!0;if(b==="uint8array"?v=f.applyCanBeUsed.uint8array:b==="nodebuffer"&&(v=f.applyCanBeUsed.nodebuffer),v)for(;1<g;)try{return f.stringifyByChunk(u,b,g)}catch{g=Math.floor(g/2)}return f.stringifyByChar(u)}function p(u,g){for(var b=0;b<u.length;b++)g[b]=u[b];return g}o.applyFromCharCode=m;var w={};w.string={string:c,array:function(u){return d(u,new Array(u.length))},arraybuffer:function(u){return w.string.uint8array(u).buffer},uint8array:function(u){return d(u,new Uint8Array(u.length))},nodebuffer:function(u){return d(u,a.allocBuffer(u.length))}},w.array={string:m,array:c,arraybuffer:function(u){return new Uint8Array(u).buffer},uint8array:function(u){return new Uint8Array(u)},nodebuffer:function(u){return a.newBufferFrom(u)}},w.arraybuffer={string:function(u){return m(new Uint8Array(u))},array:function(u){return p(new Uint8Array(u),new Array(u.byteLength))},arraybuffer:c,uint8array:function(u){return new Uint8Array(u)},nodebuffer:function(u){return a.newBufferFrom(new Uint8Array(u))}},w.uint8array={string:m,array:function(u){return p(u,new Array(u.length))},arraybuffer:function(u){return u.buffer},uint8array:c,nodebuffer:function(u){return a.newBufferFrom(u)}},w.nodebuffer={string:m,array:function(u){return p(u,new Array(u.length))},arraybuffer:function(u){return w.nodebuffer.uint8array(u).buffer},uint8array:function(u){return p(u,new Uint8Array(u.length))},nodebuffer:c},o.transformTo=function(u,g){if(g=g||"",!u)return g;o.checkSupport(u);var b=o.getTypeOf(g);return w[b][u](g)},o.resolve=function(u){for(var g=u.split("/"),b=[],v=0;v<g.length;v++){var k=g[v];k==="."||k===""&&v!==0&&v!==g.length-1||(k===".."?b.pop():b.push(k))}return b.join("/")},o.getTypeOf=function(u){return typeof u=="string"?"string":Object.prototype.toString.call(u)==="[object Array]"?"array":i.nodebuffer&&a.isBuffer(u)?"nodebuffer":i.uint8array&&u instanceof Uint8Array?"uint8array":i.arraybuffer&&u instanceof ArrayBuffer?"arraybuffer":void 0},o.checkSupport=function(u){if(!i[u.toLowerCase()])throw new Error(u+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(u){var g,b,v="";for(b=0;b<(u||"").length;b++)v+="\\x"+((g=u.charCodeAt(b))<16?"0":"")+g.toString(16).toUpperCase();return v},o.delay=function(u,g,b){setImmediate(function(){u.apply(b||null,g||[])})},o.inherits=function(u,g){function b(){}b.prototype=g.prototype,u.prototype=new b},o.extend=function(){var u,g,b={};for(u=0;u<arguments.length;u++)for(g in arguments[u])Object.prototype.hasOwnProperty.call(arguments[u],g)&&b[g]===void 0&&(b[g]=arguments[u][g]);return b},o.prepareContent=function(u,g,b,v,k){return l.Promise.resolve(g).then(function(_){return i.blob&&(_ instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(_))!==-1)&&typeof FileReader<"u"?new l.Promise(function(S,O){var z=new FileReader;z.onload=function(I){S(I.target.result)},z.onerror=function(I){O(I.target.error)},z.readAsArrayBuffer(_)}):_}).then(function(_){var S=o.getTypeOf(_);return S?(S==="arraybuffer"?_=o.transformTo("uint8array",_):S==="string"&&(k?_=s.decode(_):b&&v!==!0&&(_=(function(O){return d(O,i.uint8array?new Uint8Array(O.length):new Array(O.length))})(_))),_):l.Promise.reject(new Error("Can't read the data of '"+u+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(r,n,o){var i=r("./reader/readerFor"),s=r("./utils"),a=r("./signature"),l=r("./zipEntry"),c=r("./support");function d(f){this.files=[],this.loadOptions=f}d.prototype={checkSignature:function(f){if(!this.reader.readAndCheckSignature(f)){this.reader.index-=4;var m=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(m)+", expected "+s.pretty(f)+")")}},isSignature:function(f,m){var p=this.reader.index;this.reader.setIndex(f);var w=this.reader.readString(4)===m;return this.reader.setIndex(p),w},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var f=this.reader.readData(this.zipCommentLength),m=c.uint8array?"uint8array":"array",p=s.transformTo(m,f);this.zipComment=this.loadOptions.decodeFileName(p)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var f,m,p,w=this.zip64EndOfCentralSize-44;0<w;)f=this.reader.readInt(2),m=this.reader.readInt(4),p=this.reader.readData(m),this.zip64ExtensibleData[f]={id:f,length:m,value:p}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var f,m;for(f=0;f<this.files.length;f++)m=this.files[f],this.reader.setIndex(m.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),m.readLocalPart(this.reader),m.handleUTF8(),m.processAttributes()},readCentralDir:function(){var f;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(f=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(f);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var f=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(f<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(f);var m=f;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(f=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(f),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var p=this.centralDirOffset+this.centralDirSize;this.zip64&&(p+=20,p+=12+this.zip64EndOfCentralSize);var w=m-p;if(0<w)this.isSignature(m,a.CENTRAL_FILE_HEADER)||(this.reader.zero=w);else if(w<0)throw new Error("Corrupted zip: missing "+Math.abs(w)+" bytes.")},prepareReader:function(f){this.reader=i(f)},load:function(f){this.prepareReader(f),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},n.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(r,n,o){var i=r("./reader/readerFor"),s=r("./utils"),a=r("./compressedObject"),l=r("./crc32"),c=r("./utf8"),d=r("./compressions"),f=r("./support");function m(p,w){this.options=p,this.loadOptions=w}m.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(p){var w,u;if(p.skip(22),this.fileNameLength=p.readInt(2),u=p.readInt(2),this.fileName=p.readData(this.fileNameLength),p.skip(u),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((w=(function(g){for(var b in d)if(Object.prototype.hasOwnProperty.call(d,b)&&d[b].magic===g)return d[b];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,w,p.readData(this.compressedSize))},readCentralPart:function(p){this.versionMadeBy=p.readInt(2),p.skip(2),this.bitFlag=p.readInt(2),this.compressionMethod=p.readString(2),this.date=p.readDate(),this.crc32=p.readInt(4),this.compressedSize=p.readInt(4),this.uncompressedSize=p.readInt(4);var w=p.readInt(2);if(this.extraFieldsLength=p.readInt(2),this.fileCommentLength=p.readInt(2),this.diskNumberStart=p.readInt(2),this.internalFileAttributes=p.readInt(2),this.externalFileAttributes=p.readInt(4),this.localHeaderOffset=p.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");p.skip(w),this.readExtraFields(p),this.parseZIP64ExtraField(p),this.fileComment=p.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var p=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),p==0&&(this.dosPermissions=63&this.externalFileAttributes),p==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var p=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=p.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=p.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=p.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=p.readInt(4))}},readExtraFields:function(p){var w,u,g,b=p.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});p.index+4<b;)w=p.readInt(2),u=p.readInt(2),g=p.readData(u),this.extraFields[w]={id:w,length:u,value:g};p.setIndex(b)},handleUTF8:function(){var p=f.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var w=this.findExtraFieldUnicodePath();if(w!==null)this.fileNameStr=w;else{var u=s.transformTo(p,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(u)}var g=this.findExtraFieldUnicodeComment();if(g!==null)this.fileCommentStr=g;else{var b=s.transformTo(p,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(b)}}},findExtraFieldUnicodePath:function(){var p=this.extraFields[28789];if(p){var w=i(p.value);return w.readInt(1)!==1||l(this.fileName)!==w.readInt(4)?null:c.utf8decode(w.readData(p.length-5))}return null},findExtraFieldUnicodeComment:function(){var p=this.extraFields[25461];if(p){var w=i(p.value);return w.readInt(1)!==1||l(this.fileComment)!==w.readInt(4)?null:c.utf8decode(w.readData(p.length-5))}return null}},n.exports=m},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(r,n,o){function i(w,u,g){this.name=w,this.dir=g.dir,this.date=g.date,this.comment=g.comment,this.unixPermissions=g.unixPermissions,this.dosPermissions=g.dosPermissions,this._data=u,this._dataBinary=g.binary,this.options={compression:g.compression,compressionOptions:g.compressionOptions}}var s=r("./stream/StreamHelper"),a=r("./stream/DataWorker"),l=r("./utf8"),c=r("./compressedObject"),d=r("./stream/GenericWorker");i.prototype={internalStream:function(w){var u=null,g="string";try{if(!w)throw new Error("No output type specified.");var b=(g=w.toLowerCase())==="string"||g==="text";g!=="binarystring"&&g!=="text"||(g="string"),u=this._decompressWorker();var v=!this._dataBinary;v&&!b&&(u=u.pipe(new l.Utf8EncodeWorker)),!v&&b&&(u=u.pipe(new l.Utf8DecodeWorker))}catch(k){(u=new d("error")).error(k)}return new s(u,g,"")},async:function(w,u){return this.internalStream(w).accumulate(u)},nodeStream:function(w,u){return this.internalStream(w||"nodebuffer").toNodejsStream(u)},_compressWorker:function(w,u){if(this._data instanceof c&&this._data.compression.magic===w.magic)return this._data.getCompressedWorker();var g=this._decompressWorker();return this._dataBinary||(g=g.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(g,w,u)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof d?this._data:new a(this._data)}};for(var f=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],m=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},p=0;p<f.length;p++)i.prototype[f[p]]=m;n.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(r,n,o){(function(i){var s,a,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var c=0,d=new l(w),f=i.document.createTextNode("");d.observe(f,{characterData:!0}),s=function(){f.data=c=++c%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var u=i.document.createElement("script");u.onreadystatechange=function(){w(),u.onreadystatechange=null,u.parentNode.removeChild(u),u=null},i.document.documentElement.appendChild(u)}:function(){setTimeout(w,0)};else{var m=new i.MessageChannel;m.port1.onmessage=w,s=function(){m.port2.postMessage(0)}}var p=[];function w(){var u,g;a=!0;for(var b=p.length;b;){for(g=p,p=[],u=-1;++u<b;)g[u]();b=p.length}a=!1}n.exports=function(u){p.push(u)!==1||a||s()}}).call(this,typeof gt<"u"?gt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(r,n,o){var i=r("immediate");function s(){}var a={},l=["REJECTED"],c=["FULFILLED"],d=["PENDING"];function f(b){if(typeof b!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,b!==s&&u(this,b)}function m(b,v,k){this.promise=b,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function p(b,v,k){i(function(){var _;try{_=v(k)}catch(S){return a.reject(b,S)}_===b?a.reject(b,new TypeError("Cannot resolve promise with itself")):a.resolve(b,_)})}function w(b){var v=b&&b.then;if(b&&(typeof b=="object"||typeof b=="function")&&typeof v=="function")return function(){v.apply(b,arguments)}}function u(b,v){var k=!1;function _(z){k||(k=!0,a.reject(b,z))}function S(z){k||(k=!0,a.resolve(b,z))}var O=g(function(){v(S,_)});O.status==="error"&&_(O.value)}function g(b,v){var k={};try{k.value=b(v),k.status="success"}catch(_){k.status="error",k.value=_}return k}(n.exports=f).prototype.finally=function(b){if(typeof b!="function")return this;var v=this.constructor;return this.then(function(k){return v.resolve(b()).then(function(){return k})},function(k){return v.resolve(b()).then(function(){throw k})})},f.prototype.catch=function(b){return this.then(null,b)},f.prototype.then=function(b,v){if(typeof b!="function"&&this.state===c||typeof v!="function"&&this.state===l)return this;var k=new this.constructor(s);return this.state!==d?p(k,this.state===c?b:v,this.outcome):this.queue.push(new m(k,b,v)),k},m.prototype.callFulfilled=function(b){a.resolve(this.promise,b)},m.prototype.otherCallFulfilled=function(b){p(this.promise,this.onFulfilled,b)},m.prototype.callRejected=function(b){a.reject(this.promise,b)},m.prototype.otherCallRejected=function(b){p(this.promise,this.onRejected,b)},a.resolve=function(b,v){var k=g(w,v);if(k.status==="error")return a.reject(b,k.value);var _=k.value;if(_)u(b,_);else{b.state=c,b.outcome=v;for(var S=-1,O=b.queue.length;++S<O;)b.queue[S].callFulfilled(v)}return b},a.reject=function(b,v){b.state=l,b.outcome=v;for(var k=-1,_=b.queue.length;++k<_;)b.queue[k].callRejected(v);return b},f.resolve=function(b){return b instanceof this?b:a.resolve(new this(s),b)},f.reject=function(b){var v=new this(s);return a.reject(v,b)},f.all=function(b){var v=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=b.length,_=!1;if(!k)return this.resolve([]);for(var S=new Array(k),O=0,z=-1,I=new this(s);++z<k;)D(b[z],z);return I;function D(U,H){v.resolve(U).then(function(C){S[H]=C,++O!==k||_||(_=!0,a.resolve(I,S))},function(C){_||(_=!0,a.reject(I,C))})}},f.race=function(b){var v=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=b.length,_=!1;if(!k)return this.resolve([]);for(var S=-1,O=new this(s);++S<k;)z=b[S],v.resolve(z).then(function(I){_||(_=!0,a.resolve(O,I))},function(I){_||(_=!0,a.reject(O,I))});var z;return O}},{immediate:36}],38:[function(r,n,o){var i={};(0,r("./lib/utils/common").assign)(i,r("./lib/deflate"),r("./lib/inflate"),r("./lib/zlib/constants")),n.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(r,n,o){var i=r("./zlib/deflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/messages"),c=r("./zlib/zstream"),d=Object.prototype.toString,f=0,m=-1,p=0,w=8;function u(b){if(!(this instanceof u))return new u(b);this.options=s.assign({level:m,method:w,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:""},b||{});var v=this.options;v.raw&&0<v.windowBits?v.windowBits=-v.windowBits:v.gzip&&0<v.windowBits&&v.windowBits<16&&(v.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var k=i.deflateInit2(this.strm,v.level,v.method,v.windowBits,v.memLevel,v.strategy);if(k!==f)throw new Error(l[k]);if(v.header&&i.deflateSetHeader(this.strm,v.header),v.dictionary){var _;if(_=typeof v.dictionary=="string"?a.string2buf(v.dictionary):d.call(v.dictionary)==="[object ArrayBuffer]"?new Uint8Array(v.dictionary):v.dictionary,(k=i.deflateSetDictionary(this.strm,_))!==f)throw new Error(l[k]);this._dict_set=!0}}function g(b,v){var k=new u(v);if(k.push(b,!0),k.err)throw k.msg||l[k.err];return k.result}u.prototype.push=function(b,v){var k,_,S=this.strm,O=this.options.chunkSize;if(this.ended)return!1;_=v===~~v?v:v===!0?4:0,typeof b=="string"?S.input=a.string2buf(b):d.call(b)==="[object ArrayBuffer]"?S.input=new Uint8Array(b):S.input=b,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new s.Buf8(O),S.next_out=0,S.avail_out=O),(k=i.deflate(S,_))!==1&&k!==f)return this.onEnd(k),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||_!==4&&_!==2)||(this.options.to==="string"?this.onData(a.buf2binstring(s.shrinkBuf(S.output,S.next_out))):this.onData(s.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&k!==1);return _===4?(k=i.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===f):_!==2||(this.onEnd(f),!(S.avail_out=0))},u.prototype.onData=function(b){this.chunks.push(b)},u.prototype.onEnd=function(b){b===f&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg},o.Deflate=u,o.deflate=g,o.deflateRaw=function(b,v){return(v=v||{}).raw=!0,g(b,v)},o.gzip=function(b,v){return(v=v||{}).gzip=!0,g(b,v)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(r,n,o){var i=r("./zlib/inflate"),s=r("./utils/common"),a=r("./utils/strings"),l=r("./zlib/constants"),c=r("./zlib/messages"),d=r("./zlib/zstream"),f=r("./zlib/gzheader"),m=Object.prototype.toString;function p(u){if(!(this instanceof p))return new p(u);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},u||{});var g=this.options;g.raw&&0<=g.windowBits&&g.windowBits<16&&(g.windowBits=-g.windowBits,g.windowBits===0&&(g.windowBits=-15)),!(0<=g.windowBits&&g.windowBits<16)||u&&u.windowBits||(g.windowBits+=32),15<g.windowBits&&g.windowBits<48&&(15&g.windowBits)==0&&(g.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var b=i.inflateInit2(this.strm,g.windowBits);if(b!==l.Z_OK)throw new Error(c[b]);this.header=new f,i.inflateGetHeader(this.strm,this.header)}function w(u,g){var b=new p(g);if(b.push(u,!0),b.err)throw b.msg||c[b.err];return b.result}p.prototype.push=function(u,g){var b,v,k,_,S,O,z=this.strm,I=this.options.chunkSize,D=this.options.dictionary,U=!1;if(this.ended)return!1;v=g===~~g?g:g===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof u=="string"?z.input=a.binstring2buf(u):m.call(u)==="[object ArrayBuffer]"?z.input=new Uint8Array(u):z.input=u,z.next_in=0,z.avail_in=z.input.length;do{if(z.avail_out===0&&(z.output=new s.Buf8(I),z.next_out=0,z.avail_out=I),(b=i.inflate(z,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&D&&(O=typeof D=="string"?a.string2buf(D):m.call(D)==="[object ArrayBuffer]"?new Uint8Array(D):D,b=i.inflateSetDictionary(this.strm,O)),b===l.Z_BUF_ERROR&&U===!0&&(b=l.Z_OK,U=!1),b!==l.Z_STREAM_END&&b!==l.Z_OK)return this.onEnd(b),!(this.ended=!0);z.next_out&&(z.avail_out!==0&&b!==l.Z_STREAM_END&&(z.avail_in!==0||v!==l.Z_FINISH&&v!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=a.utf8border(z.output,z.next_out),_=z.next_out-k,S=a.buf2string(z.output,k),z.next_out=_,z.avail_out=I-_,_&&s.arraySet(z.output,z.output,k,_,0),this.onData(S)):this.onData(s.shrinkBuf(z.output,z.next_out)))),z.avail_in===0&&z.avail_out===0&&(U=!0)}while((0<z.avail_in||z.avail_out===0)&&b!==l.Z_STREAM_END);return b===l.Z_STREAM_END&&(v=l.Z_FINISH),v===l.Z_FINISH?(b=i.inflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===l.Z_OK):v!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(z.avail_out=0))},p.prototype.onData=function(u){this.chunks.push(u)},p.prototype.onEnd=function(u){u===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=u,this.msg=this.strm.msg},o.Inflate=p,o.inflate=w,o.inflateRaw=function(u,g){return(g=g||{}).raw=!0,w(u,g)},o.ungzip=w},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(r,n,o){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";o.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var d=c.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var f in d)d.hasOwnProperty(f)&&(l[f]=d[f])}}return l},o.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,d,f,m){if(c.subarray&&l.subarray)l.set(c.subarray(d,d+f),m);else for(var p=0;p<f;p++)l[m+p]=c[d+p]},flattenChunks:function(l){var c,d,f,m,p,w;for(c=f=0,d=l.length;c<d;c++)f+=l[c].length;for(w=new Uint8Array(f),c=m=0,d=l.length;c<d;c++)p=l[c],w.set(p,m),m+=p.length;return w}},a={arraySet:function(l,c,d,f,m){for(var p=0;p<f;p++)l[m+p]=c[d+p]},flattenChunks:function(l){return[].concat.apply([],l)}};o.setTyped=function(l){l?(o.Buf8=Uint8Array,o.Buf16=Uint16Array,o.Buf32=Int32Array,o.assign(o,s)):(o.Buf8=Array,o.Buf16=Array,o.Buf32=Array,o.assign(o,a))},o.setTyped(i)},{}],42:[function(r,n,o){var i=r("./common"),s=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var l=new i.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function d(f,m){if(m<65537&&(f.subarray&&a||!f.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(f,m));for(var p="",w=0;w<m;w++)p+=String.fromCharCode(f[w]);return p}l[254]=l[254]=1,o.string2buf=function(f){var m,p,w,u,g,b=f.length,v=0;for(u=0;u<b;u++)(64512&(p=f.charCodeAt(u)))==55296&&u+1<b&&(64512&(w=f.charCodeAt(u+1)))==56320&&(p=65536+(p-55296<<10)+(w-56320),u++),v+=p<128?1:p<2048?2:p<65536?3:4;for(m=new i.Buf8(v),u=g=0;g<v;u++)(64512&(p=f.charCodeAt(u)))==55296&&u+1<b&&(64512&(w=f.charCodeAt(u+1)))==56320&&(p=65536+(p-55296<<10)+(w-56320),u++),p<128?m[g++]=p:(p<2048?m[g++]=192|p>>>6:(p<65536?m[g++]=224|p>>>12:(m[g++]=240|p>>>18,m[g++]=128|p>>>12&63),m[g++]=128|p>>>6&63),m[g++]=128|63&p);return m},o.buf2binstring=function(f){return d(f,f.length)},o.binstring2buf=function(f){for(var m=new i.Buf8(f.length),p=0,w=m.length;p<w;p++)m[p]=f.charCodeAt(p);return m},o.buf2string=function(f,m){var p,w,u,g,b=m||f.length,v=new Array(2*b);for(p=w=0;p<b;)if((u=f[p++])<128)v[w++]=u;else if(4<(g=l[u]))v[w++]=65533,p+=g-1;else{for(u&=g===2?31:g===3?15:7;1<g&&p<b;)u=u<<6|63&f[p++],g--;1<g?v[w++]=65533:u<65536?v[w++]=u:(u-=65536,v[w++]=55296|u>>10&1023,v[w++]=56320|1023&u)}return d(v,w)},o.utf8border=function(f,m){var p;for((m=m||f.length)>f.length&&(m=f.length),p=m-1;0<=p&&(192&f[p])==128;)p--;return p<0||p===0?m:p+l[f[p]]>m?p:m}},{"./common":41}],43:[function(r,n,o){n.exports=function(i,s,a,l){for(var c=65535&i|0,d=i>>>16&65535|0,f=0;a!==0;){for(a-=f=2e3<a?2e3:a;d=d+(c=c+s[l++]|0)|0,--f;);c%=65521,d%=65521}return c|d<<16|0}},{}],44:[function(r,n,o){n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(r,n,o){var i=(function(){for(var s,a=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;a[l]=s}return a})();n.exports=function(s,a,l,c){var d=i,f=c+l;s^=-1;for(var m=c;m<f;m++)s=s>>>8^d[255&(s^a[m])];return-1^s}},{}],46:[function(r,n,o){var i,s=r("../utils/common"),a=r("./trees"),l=r("./adler32"),c=r("./crc32"),d=r("./messages"),f=0,m=4,p=0,w=-2,u=-1,g=4,b=2,v=8,k=9,_=286,S=30,O=19,z=2*_+1,I=15,D=3,U=258,H=U+D+1,C=42,M=113,y=1,L=2,Q=3,F=4;function $(x,K){return x.msg=d[K],K}function V(x){return(x<<1)-(4<x?9:0)}function re(x){for(var K=x.length;0<=--K;)x[K]=0}function A(x){var K=x.state,W=K.pending;W>x.avail_out&&(W=x.avail_out),W!==0&&(s.arraySet(x.output,K.pending_buf,K.pending_out,W,x.next_out),x.next_out+=W,K.pending_out+=W,x.total_out+=W,x.avail_out-=W,K.pending-=W,K.pending===0&&(K.pending_out=0))}function P(x,K){a._tr_flush_block(x,0<=x.block_start?x.block_start:-1,x.strstart-x.block_start,K),x.block_start=x.strstart,A(x.strm)}function J(x,K){x.pending_buf[x.pending++]=K}function G(x,K){x.pending_buf[x.pending++]=K>>>8&255,x.pending_buf[x.pending++]=255&K}function te(x,K){var W,T,j=x.max_chain_length,R=x.strstart,Y=x.prev_length,X=x.nice_match,B=x.strstart>x.w_size-H?x.strstart-(x.w_size-H):0,ne=x.window,fe=x.w_mask,se=x.prev,Z=x.strstart+U,de=ne[R+Y-1],le=ne[R+Y];x.prev_length>=x.good_match&&(j>>=2),X>x.lookahead&&(X=x.lookahead);do if(ne[(W=K)+Y]===le&&ne[W+Y-1]===de&&ne[W]===ne[R]&&ne[++W]===ne[R+1]){R+=2,W++;do;while(ne[++R]===ne[++W]&&ne[++R]===ne[++W]&&ne[++R]===ne[++W]&&ne[++R]===ne[++W]&&ne[++R]===ne[++W]&&ne[++R]===ne[++W]&&ne[++R]===ne[++W]&&ne[++R]===ne[++W]&&R<Z);if(T=U-(Z-R),R=Z-U,Y<T){if(x.match_start=K,X<=(Y=T))break;de=ne[R+Y-1],le=ne[R+Y]}}while((K=se[K&fe])>B&&--j!=0);return Y<=x.lookahead?Y:x.lookahead}function ce(x){var K,W,T,j,R,Y,X,B,ne,fe,se=x.w_size;do{if(j=x.window_size-x.lookahead-x.strstart,x.strstart>=se+(se-H)){for(s.arraySet(x.window,x.window,se,se,0),x.match_start-=se,x.strstart-=se,x.block_start-=se,K=W=x.hash_size;T=x.head[--K],x.head[K]=se<=T?T-se:0,--W;);for(K=W=se;T=x.prev[--K],x.prev[K]=se<=T?T-se:0,--W;);j+=se}if(x.strm.avail_in===0)break;if(Y=x.strm,X=x.window,B=x.strstart+x.lookahead,ne=j,fe=void 0,fe=Y.avail_in,ne<fe&&(fe=ne),W=fe===0?0:(Y.avail_in-=fe,s.arraySet(X,Y.input,Y.next_in,fe,B),Y.state.wrap===1?Y.adler=l(Y.adler,X,fe,B):Y.state.wrap===2&&(Y.adler=c(Y.adler,X,fe,B)),Y.next_in+=fe,Y.total_in+=fe,fe),x.lookahead+=W,x.lookahead+x.insert>=D)for(R=x.strstart-x.insert,x.ins_h=x.window[R],x.ins_h=(x.ins_h<<x.hash_shift^x.window[R+1])&x.hash_mask;x.insert&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[R+D-1])&x.hash_mask,x.prev[R&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=R,R++,x.insert--,!(x.lookahead+x.insert<D)););}while(x.lookahead<H&&x.strm.avail_in!==0)}function q(x,K){for(var W,T;;){if(x.lookahead<H){if(ce(x),x.lookahead<H&&K===f)return y;if(x.lookahead===0)break}if(W=0,x.lookahead>=D&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+D-1])&x.hash_mask,W=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),W!==0&&x.strstart-W<=x.w_size-H&&(x.match_length=te(x,W)),x.match_length>=D)if(T=a._tr_tally(x,x.strstart-x.match_start,x.match_length-D),x.lookahead-=x.match_length,x.match_length<=x.max_lazy_match&&x.lookahead>=D){for(x.match_length--;x.strstart++,x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+D-1])&x.hash_mask,W=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart,--x.match_length!=0;);x.strstart++}else x.strstart+=x.match_length,x.match_length=0,x.ins_h=x.window[x.strstart],x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+1])&x.hash_mask;else T=a._tr_tally(x,0,x.window[x.strstart]),x.lookahead--,x.strstart++;if(T&&(P(x,!1),x.strm.avail_out===0))return y}return x.insert=x.strstart<D-1?x.strstart:D-1,K===m?(P(x,!0),x.strm.avail_out===0?Q:F):x.last_lit&&(P(x,!1),x.strm.avail_out===0)?y:L}function ie(x,K){for(var W,T,j;;){if(x.lookahead<H){if(ce(x),x.lookahead<H&&K===f)return y;if(x.lookahead===0)break}if(W=0,x.lookahead>=D&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+D-1])&x.hash_mask,W=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),x.prev_length=x.match_length,x.prev_match=x.match_start,x.match_length=D-1,W!==0&&x.prev_length<x.max_lazy_match&&x.strstart-W<=x.w_size-H&&(x.match_length=te(x,W),x.match_length<=5&&(x.strategy===1||x.match_length===D&&4096<x.strstart-x.match_start)&&(x.match_length=D-1)),x.prev_length>=D&&x.match_length<=x.prev_length){for(j=x.strstart+x.lookahead-D,T=a._tr_tally(x,x.strstart-1-x.prev_match,x.prev_length-D),x.lookahead-=x.prev_length-1,x.prev_length-=2;++x.strstart<=j&&(x.ins_h=(x.ins_h<<x.hash_shift^x.window[x.strstart+D-1])&x.hash_mask,W=x.prev[x.strstart&x.w_mask]=x.head[x.ins_h],x.head[x.ins_h]=x.strstart),--x.prev_length!=0;);if(x.match_available=0,x.match_length=D-1,x.strstart++,T&&(P(x,!1),x.strm.avail_out===0))return y}else if(x.match_available){if((T=a._tr_tally(x,0,x.window[x.strstart-1]))&&P(x,!1),x.strstart++,x.lookahead--,x.strm.avail_out===0)return y}else x.match_available=1,x.strstart++,x.lookahead--}return x.match_available&&(T=a._tr_tally(x,0,x.window[x.strstart-1]),x.match_available=0),x.insert=x.strstart<D-1?x.strstart:D-1,K===m?(P(x,!0),x.strm.avail_out===0?Q:F):x.last_lit&&(P(x,!1),x.strm.avail_out===0)?y:L}function ue(x,K,W,T,j){this.good_length=x,this.max_lazy=K,this.nice_length=W,this.max_chain=T,this.func=j}function ae(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=v,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*z),this.dyn_dtree=new s.Buf16(2*(2*S+1)),this.bl_tree=new s.Buf16(2*(2*O+1)),re(this.dyn_ltree),re(this.dyn_dtree),re(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(I+1),this.heap=new s.Buf16(2*_+1),re(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*_+1),re(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function pe(x){var K;return x&&x.state?(x.total_in=x.total_out=0,x.data_type=b,(K=x.state).pending=0,K.pending_out=0,K.wrap<0&&(K.wrap=-K.wrap),K.status=K.wrap?C:M,x.adler=K.wrap===2?0:1,K.last_flush=f,a._tr_init(K),p):$(x,w)}function ve(x){var K=pe(x);return K===p&&(function(W){W.window_size=2*W.w_size,re(W.head),W.max_lazy_match=i[W.level].max_lazy,W.good_match=i[W.level].good_length,W.nice_match=i[W.level].nice_length,W.max_chain_length=i[W.level].max_chain,W.strstart=0,W.block_start=0,W.lookahead=0,W.insert=0,W.match_length=W.prev_length=D-1,W.match_available=0,W.ins_h=0})(x.state),K}function _e(x,K,W,T,j,R){if(!x)return w;var Y=1;if(K===u&&(K=6),T<0?(Y=0,T=-T):15<T&&(Y=2,T-=16),j<1||k<j||W!==v||T<8||15<T||K<0||9<K||R<0||g<R)return $(x,w);T===8&&(T=9);var X=new ae;return(x.state=X).strm=x,X.wrap=Y,X.gzhead=null,X.w_bits=T,X.w_size=1<<X.w_bits,X.w_mask=X.w_size-1,X.hash_bits=j+7,X.hash_size=1<<X.hash_bits,X.hash_mask=X.hash_size-1,X.hash_shift=~~((X.hash_bits+D-1)/D),X.window=new s.Buf8(2*X.w_size),X.head=new s.Buf16(X.hash_size),X.prev=new s.Buf16(X.w_size),X.lit_bufsize=1<<j+6,X.pending_buf_size=4*X.lit_bufsize,X.pending_buf=new s.Buf8(X.pending_buf_size),X.d_buf=1*X.lit_bufsize,X.l_buf=3*X.lit_bufsize,X.level=K,X.strategy=R,X.method=W,ve(x)}i=[new ue(0,0,0,0,function(x,K){var W=65535;for(W>x.pending_buf_size-5&&(W=x.pending_buf_size-5);;){if(x.lookahead<=1){if(ce(x),x.lookahead===0&&K===f)return y;if(x.lookahead===0)break}x.strstart+=x.lookahead,x.lookahead=0;var T=x.block_start+W;if((x.strstart===0||x.strstart>=T)&&(x.lookahead=x.strstart-T,x.strstart=T,P(x,!1),x.strm.avail_out===0)||x.strstart-x.block_start>=x.w_size-H&&(P(x,!1),x.strm.avail_out===0))return y}return x.insert=0,K===m?(P(x,!0),x.strm.avail_out===0?Q:F):(x.strstart>x.block_start&&(P(x,!1),x.strm.avail_out),y)}),new ue(4,4,8,4,q),new ue(4,5,16,8,q),new ue(4,6,32,32,q),new ue(4,4,16,16,ie),new ue(8,16,32,32,ie),new ue(8,16,128,128,ie),new ue(8,32,128,256,ie),new ue(32,128,258,1024,ie),new ue(32,258,258,4096,ie)],o.deflateInit=function(x,K){return _e(x,K,v,15,8,0)},o.deflateInit2=_e,o.deflateReset=ve,o.deflateResetKeep=pe,o.deflateSetHeader=function(x,K){return x&&x.state?x.state.wrap!==2?w:(x.state.gzhead=K,p):w},o.deflate=function(x,K){var W,T,j,R;if(!x||!x.state||5<K||K<0)return x?$(x,w):w;if(T=x.state,!x.output||!x.input&&x.avail_in!==0||T.status===666&&K!==m)return $(x,x.avail_out===0?-5:w);if(T.strm=x,W=T.last_flush,T.last_flush=K,T.status===C)if(T.wrap===2)x.adler=0,J(T,31),J(T,139),J(T,8),T.gzhead?(J(T,(T.gzhead.text?1:0)+(T.gzhead.hcrc?2:0)+(T.gzhead.extra?4:0)+(T.gzhead.name?8:0)+(T.gzhead.comment?16:0)),J(T,255&T.gzhead.time),J(T,T.gzhead.time>>8&255),J(T,T.gzhead.time>>16&255),J(T,T.gzhead.time>>24&255),J(T,T.level===9?2:2<=T.strategy||T.level<2?4:0),J(T,255&T.gzhead.os),T.gzhead.extra&&T.gzhead.extra.length&&(J(T,255&T.gzhead.extra.length),J(T,T.gzhead.extra.length>>8&255)),T.gzhead.hcrc&&(x.adler=c(x.adler,T.pending_buf,T.pending,0)),T.gzindex=0,T.status=69):(J(T,0),J(T,0),J(T,0),J(T,0),J(T,0),J(T,T.level===9?2:2<=T.strategy||T.level<2?4:0),J(T,3),T.status=M);else{var Y=v+(T.w_bits-8<<4)<<8;Y|=(2<=T.strategy||T.level<2?0:T.level<6?1:T.level===6?2:3)<<6,T.strstart!==0&&(Y|=32),Y+=31-Y%31,T.status=M,G(T,Y),T.strstart!==0&&(G(T,x.adler>>>16),G(T,65535&x.adler)),x.adler=1}if(T.status===69)if(T.gzhead.extra){for(j=T.pending;T.gzindex<(65535&T.gzhead.extra.length)&&(T.pending!==T.pending_buf_size||(T.gzhead.hcrc&&T.pending>j&&(x.adler=c(x.adler,T.pending_buf,T.pending-j,j)),A(x),j=T.pending,T.pending!==T.pending_buf_size));)J(T,255&T.gzhead.extra[T.gzindex]),T.gzindex++;T.gzhead.hcrc&&T.pending>j&&(x.adler=c(x.adler,T.pending_buf,T.pending-j,j)),T.gzindex===T.gzhead.extra.length&&(T.gzindex=0,T.status=73)}else T.status=73;if(T.status===73)if(T.gzhead.name){j=T.pending;do{if(T.pending===T.pending_buf_size&&(T.gzhead.hcrc&&T.pending>j&&(x.adler=c(x.adler,T.pending_buf,T.pending-j,j)),A(x),j=T.pending,T.pending===T.pending_buf_size)){R=1;break}R=T.gzindex<T.gzhead.name.length?255&T.gzhead.name.charCodeAt(T.gzindex++):0,J(T,R)}while(R!==0);T.gzhead.hcrc&&T.pending>j&&(x.adler=c(x.adler,T.pending_buf,T.pending-j,j)),R===0&&(T.gzindex=0,T.status=91)}else T.status=91;if(T.status===91)if(T.gzhead.comment){j=T.pending;do{if(T.pending===T.pending_buf_size&&(T.gzhead.hcrc&&T.pending>j&&(x.adler=c(x.adler,T.pending_buf,T.pending-j,j)),A(x),j=T.pending,T.pending===T.pending_buf_size)){R=1;break}R=T.gzindex<T.gzhead.comment.length?255&T.gzhead.comment.charCodeAt(T.gzindex++):0,J(T,R)}while(R!==0);T.gzhead.hcrc&&T.pending>j&&(x.adler=c(x.adler,T.pending_buf,T.pending-j,j)),R===0&&(T.status=103)}else T.status=103;if(T.status===103&&(T.gzhead.hcrc?(T.pending+2>T.pending_buf_size&&A(x),T.pending+2<=T.pending_buf_size&&(J(T,255&x.adler),J(T,x.adler>>8&255),x.adler=0,T.status=M)):T.status=M),T.pending!==0){if(A(x),x.avail_out===0)return T.last_flush=-1,p}else if(x.avail_in===0&&V(K)<=V(W)&&K!==m)return $(x,-5);if(T.status===666&&x.avail_in!==0)return $(x,-5);if(x.avail_in!==0||T.lookahead!==0||K!==f&&T.status!==666){var X=T.strategy===2?(function(B,ne){for(var fe;;){if(B.lookahead===0&&(ce(B),B.lookahead===0)){if(ne===f)return y;break}if(B.match_length=0,fe=a._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++,fe&&(P(B,!1),B.strm.avail_out===0))return y}return B.insert=0,ne===m?(P(B,!0),B.strm.avail_out===0?Q:F):B.last_lit&&(P(B,!1),B.strm.avail_out===0)?y:L})(T,K):T.strategy===3?(function(B,ne){for(var fe,se,Z,de,le=B.window;;){if(B.lookahead<=U){if(ce(B),B.lookahead<=U&&ne===f)return y;if(B.lookahead===0)break}if(B.match_length=0,B.lookahead>=D&&0<B.strstart&&(se=le[Z=B.strstart-1])===le[++Z]&&se===le[++Z]&&se===le[++Z]){de=B.strstart+U;do;while(se===le[++Z]&&se===le[++Z]&&se===le[++Z]&&se===le[++Z]&&se===le[++Z]&&se===le[++Z]&&se===le[++Z]&&se===le[++Z]&&Z<de);B.match_length=U-(de-Z),B.match_length>B.lookahead&&(B.match_length=B.lookahead)}if(B.match_length>=D?(fe=a._tr_tally(B,1,B.match_length-D),B.lookahead-=B.match_length,B.strstart+=B.match_length,B.match_length=0):(fe=a._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++),fe&&(P(B,!1),B.strm.avail_out===0))return y}return B.insert=0,ne===m?(P(B,!0),B.strm.avail_out===0?Q:F):B.last_lit&&(P(B,!1),B.strm.avail_out===0)?y:L})(T,K):i[T.level].func(T,K);if(X!==Q&&X!==F||(T.status=666),X===y||X===Q)return x.avail_out===0&&(T.last_flush=-1),p;if(X===L&&(K===1?a._tr_align(T):K!==5&&(a._tr_stored_block(T,0,0,!1),K===3&&(re(T.head),T.lookahead===0&&(T.strstart=0,T.block_start=0,T.insert=0))),A(x),x.avail_out===0))return T.last_flush=-1,p}return K!==m?p:T.wrap<=0?1:(T.wrap===2?(J(T,255&x.adler),J(T,x.adler>>8&255),J(T,x.adler>>16&255),J(T,x.adler>>24&255),J(T,255&x.total_in),J(T,x.total_in>>8&255),J(T,x.total_in>>16&255),J(T,x.total_in>>24&255)):(G(T,x.adler>>>16),G(T,65535&x.adler)),A(x),0<T.wrap&&(T.wrap=-T.wrap),T.pending!==0?p:1)},o.deflateEnd=function(x){var K;return x&&x.state?(K=x.state.status)!==C&&K!==69&&K!==73&&K!==91&&K!==103&&K!==M&&K!==666?$(x,w):(x.state=null,K===M?$(x,-3):p):w},o.deflateSetDictionary=function(x,K){var W,T,j,R,Y,X,B,ne,fe=K.length;if(!x||!x.state||(R=(W=x.state).wrap)===2||R===1&&W.status!==C||W.lookahead)return w;for(R===1&&(x.adler=l(x.adler,K,fe,0)),W.wrap=0,fe>=W.w_size&&(R===0&&(re(W.head),W.strstart=0,W.block_start=0,W.insert=0),ne=new s.Buf8(W.w_size),s.arraySet(ne,K,fe-W.w_size,W.w_size,0),K=ne,fe=W.w_size),Y=x.avail_in,X=x.next_in,B=x.input,x.avail_in=fe,x.next_in=0,x.input=K,ce(W);W.lookahead>=D;){for(T=W.strstart,j=W.lookahead-(D-1);W.ins_h=(W.ins_h<<W.hash_shift^W.window[T+D-1])&W.hash_mask,W.prev[T&W.w_mask]=W.head[W.ins_h],W.head[W.ins_h]=T,T++,--j;);W.strstart=T,W.lookahead=D-1,ce(W)}return W.strstart+=W.lookahead,W.block_start=W.strstart,W.insert=W.lookahead,W.lookahead=0,W.match_length=W.prev_length=D-1,W.match_available=0,x.next_in=X,x.input=B,x.avail_in=Y,W.wrap=R,p},o.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(r,n,o){n.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(r,n,o){n.exports=function(i,s){var a,l,c,d,f,m,p,w,u,g,b,v,k,_,S,O,z,I,D,U,H,C,M,y,L;a=i.state,l=i.next_in,y=i.input,c=l+(i.avail_in-5),d=i.next_out,L=i.output,f=d-(s-i.avail_out),m=d+(i.avail_out-257),p=a.dmax,w=a.wsize,u=a.whave,g=a.wnext,b=a.window,v=a.hold,k=a.bits,_=a.lencode,S=a.distcode,O=(1<<a.lenbits)-1,z=(1<<a.distbits)-1;e:do{k<15&&(v+=y[l++]<<k,k+=8,v+=y[l++]<<k,k+=8),I=_[v&O];t:for(;;){if(v>>>=D=I>>>24,k-=D,(D=I>>>16&255)===0)L[d++]=65535&I;else{if(!(16&D)){if((64&D)==0){I=_[(65535&I)+(v&(1<<D)-1)];continue t}if(32&D){a.mode=12;break e}i.msg="invalid literal/length code",a.mode=30;break e}U=65535&I,(D&=15)&&(k<D&&(v+=y[l++]<<k,k+=8),U+=v&(1<<D)-1,v>>>=D,k-=D),k<15&&(v+=y[l++]<<k,k+=8,v+=y[l++]<<k,k+=8),I=S[v&z];r:for(;;){if(v>>>=D=I>>>24,k-=D,!(16&(D=I>>>16&255))){if((64&D)==0){I=S[(65535&I)+(v&(1<<D)-1)];continue r}i.msg="invalid distance code",a.mode=30;break e}if(H=65535&I,k<(D&=15)&&(v+=y[l++]<<k,(k+=8)<D&&(v+=y[l++]<<k,k+=8)),p<(H+=v&(1<<D)-1)){i.msg="invalid distance too far back",a.mode=30;break e}if(v>>>=D,k-=D,(D=d-f)<H){if(u<(D=H-D)&&a.sane){i.msg="invalid distance too far back",a.mode=30;break e}if(M=b,(C=0)===g){if(C+=w-D,D<U){for(U-=D;L[d++]=b[C++],--D;);C=d-H,M=L}}else if(g<D){if(C+=w+g-D,(D-=g)<U){for(U-=D;L[d++]=b[C++],--D;);if(C=0,g<U){for(U-=D=g;L[d++]=b[C++],--D;);C=d-H,M=L}}}else if(C+=g-D,D<U){for(U-=D;L[d++]=b[C++],--D;);C=d-H,M=L}for(;2<U;)L[d++]=M[C++],L[d++]=M[C++],L[d++]=M[C++],U-=3;U&&(L[d++]=M[C++],1<U&&(L[d++]=M[C++]))}else{for(C=d-H;L[d++]=L[C++],L[d++]=L[C++],L[d++]=L[C++],2<(U-=3););U&&(L[d++]=L[C++],1<U&&(L[d++]=L[C++]))}break}}break}}while(l<c&&d<m);l-=U=k>>3,v&=(1<<(k-=U<<3))-1,i.next_in=l,i.next_out=d,i.avail_in=l<c?c-l+5:5-(l-c),i.avail_out=d<m?m-d+257:257-(d-m),a.hold=v,a.bits=k}},{}],49:[function(r,n,o){var i=r("../utils/common"),s=r("./adler32"),a=r("./crc32"),l=r("./inffast"),c=r("./inftrees"),d=1,f=2,m=0,p=-2,w=1,u=852,g=592;function b(C){return(C>>>24&255)+(C>>>8&65280)+((65280&C)<<8)+((255&C)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function k(C){var M;return C&&C.state?(M=C.state,C.total_in=C.total_out=M.total=0,C.msg="",M.wrap&&(C.adler=1&M.wrap),M.mode=w,M.last=0,M.havedict=0,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new i.Buf32(u),M.distcode=M.distdyn=new i.Buf32(g),M.sane=1,M.back=-1,m):p}function _(C){var M;return C&&C.state?((M=C.state).wsize=0,M.whave=0,M.wnext=0,k(C)):p}function S(C,M){var y,L;return C&&C.state?(L=C.state,M<0?(y=0,M=-M):(y=1+(M>>4),M<48&&(M&=15)),M&&(M<8||15<M)?p:(L.window!==null&&L.wbits!==M&&(L.window=null),L.wrap=y,L.wbits=M,_(C))):p}function O(C,M){var y,L;return C?(L=new v,(C.state=L).window=null,(y=S(C,M))!==m&&(C.state=null),y):p}var z,I,D=!0;function U(C){if(D){var M;for(z=new i.Buf32(512),I=new i.Buf32(32),M=0;M<144;)C.lens[M++]=8;for(;M<256;)C.lens[M++]=9;for(;M<280;)C.lens[M++]=7;for(;M<288;)C.lens[M++]=8;for(c(d,C.lens,0,288,z,0,C.work,{bits:9}),M=0;M<32;)C.lens[M++]=5;c(f,C.lens,0,32,I,0,C.work,{bits:5}),D=!1}C.lencode=z,C.lenbits=9,C.distcode=I,C.distbits=5}function H(C,M,y,L){var Q,F=C.state;return F.window===null&&(F.wsize=1<<F.wbits,F.wnext=0,F.whave=0,F.window=new i.Buf8(F.wsize)),L>=F.wsize?(i.arraySet(F.window,M,y-F.wsize,F.wsize,0),F.wnext=0,F.whave=F.wsize):(L<(Q=F.wsize-F.wnext)&&(Q=L),i.arraySet(F.window,M,y-L,Q,F.wnext),(L-=Q)?(i.arraySet(F.window,M,y-L,L,0),F.wnext=L,F.whave=F.wsize):(F.wnext+=Q,F.wnext===F.wsize&&(F.wnext=0),F.whave<F.wsize&&(F.whave+=Q))),0}o.inflateReset=_,o.inflateReset2=S,o.inflateResetKeep=k,o.inflateInit=function(C){return O(C,15)},o.inflateInit2=O,o.inflate=function(C,M){var y,L,Q,F,$,V,re,A,P,J,G,te,ce,q,ie,ue,ae,pe,ve,_e,x,K,W,T,j=0,R=new i.Buf8(4),Y=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!C||!C.state||!C.output||!C.input&&C.avail_in!==0)return p;(y=C.state).mode===12&&(y.mode=13),$=C.next_out,Q=C.output,re=C.avail_out,F=C.next_in,L=C.input,V=C.avail_in,A=y.hold,P=y.bits,J=V,G=re,K=m;e:for(;;)switch(y.mode){case w:if(y.wrap===0){y.mode=13;break}for(;P<16;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}if(2&y.wrap&&A===35615){R[y.check=0]=255&A,R[1]=A>>>8&255,y.check=a(y.check,R,2,0),P=A=0,y.mode=2;break}if(y.flags=0,y.head&&(y.head.done=!1),!(1&y.wrap)||(((255&A)<<8)+(A>>8))%31){C.msg="incorrect header check",y.mode=30;break}if((15&A)!=8){C.msg="unknown compression method",y.mode=30;break}if(P-=4,x=8+(15&(A>>>=4)),y.wbits===0)y.wbits=x;else if(x>y.wbits){C.msg="invalid window size",y.mode=30;break}y.dmax=1<<x,C.adler=y.check=1,y.mode=512&A?10:12,P=A=0;break;case 2:for(;P<16;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}if(y.flags=A,(255&y.flags)!=8){C.msg="unknown compression method",y.mode=30;break}if(57344&y.flags){C.msg="unknown header flags set",y.mode=30;break}y.head&&(y.head.text=A>>8&1),512&y.flags&&(R[0]=255&A,R[1]=A>>>8&255,y.check=a(y.check,R,2,0)),P=A=0,y.mode=3;case 3:for(;P<32;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}y.head&&(y.head.time=A),512&y.flags&&(R[0]=255&A,R[1]=A>>>8&255,R[2]=A>>>16&255,R[3]=A>>>24&255,y.check=a(y.check,R,4,0)),P=A=0,y.mode=4;case 4:for(;P<16;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}y.head&&(y.head.xflags=255&A,y.head.os=A>>8),512&y.flags&&(R[0]=255&A,R[1]=A>>>8&255,y.check=a(y.check,R,2,0)),P=A=0,y.mode=5;case 5:if(1024&y.flags){for(;P<16;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}y.length=A,y.head&&(y.head.extra_len=A),512&y.flags&&(R[0]=255&A,R[1]=A>>>8&255,y.check=a(y.check,R,2,0)),P=A=0}else y.head&&(y.head.extra=null);y.mode=6;case 6:if(1024&y.flags&&(V<(te=y.length)&&(te=V),te&&(y.head&&(x=y.head.extra_len-y.length,y.head.extra||(y.head.extra=new Array(y.head.extra_len)),i.arraySet(y.head.extra,L,F,te,x)),512&y.flags&&(y.check=a(y.check,L,te,F)),V-=te,F+=te,y.length-=te),y.length))break e;y.length=0,y.mode=7;case 7:if(2048&y.flags){if(V===0)break e;for(te=0;x=L[F+te++],y.head&&x&&y.length<65536&&(y.head.name+=String.fromCharCode(x)),x&&te<V;);if(512&y.flags&&(y.check=a(y.check,L,te,F)),V-=te,F+=te,x)break e}else y.head&&(y.head.name=null);y.length=0,y.mode=8;case 8:if(4096&y.flags){if(V===0)break e;for(te=0;x=L[F+te++],y.head&&x&&y.length<65536&&(y.head.comment+=String.fromCharCode(x)),x&&te<V;);if(512&y.flags&&(y.check=a(y.check,L,te,F)),V-=te,F+=te,x)break e}else y.head&&(y.head.comment=null);y.mode=9;case 9:if(512&y.flags){for(;P<16;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}if(A!==(65535&y.check)){C.msg="header crc mismatch",y.mode=30;break}P=A=0}y.head&&(y.head.hcrc=y.flags>>9&1,y.head.done=!0),C.adler=y.check=0,y.mode=12;break;case 10:for(;P<32;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}C.adler=y.check=b(A),P=A=0,y.mode=11;case 11:if(y.havedict===0)return C.next_out=$,C.avail_out=re,C.next_in=F,C.avail_in=V,y.hold=A,y.bits=P,2;C.adler=y.check=1,y.mode=12;case 12:if(M===5||M===6)break e;case 13:if(y.last){A>>>=7&P,P-=7&P,y.mode=27;break}for(;P<3;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}switch(y.last=1&A,P-=1,3&(A>>>=1)){case 0:y.mode=14;break;case 1:if(U(y),y.mode=20,M!==6)break;A>>>=2,P-=2;break e;case 2:y.mode=17;break;case 3:C.msg="invalid block type",y.mode=30}A>>>=2,P-=2;break;case 14:for(A>>>=7&P,P-=7&P;P<32;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}if((65535&A)!=(A>>>16^65535)){C.msg="invalid stored block lengths",y.mode=30;break}if(y.length=65535&A,P=A=0,y.mode=15,M===6)break e;case 15:y.mode=16;case 16:if(te=y.length){if(V<te&&(te=V),re<te&&(te=re),te===0)break e;i.arraySet(Q,L,F,te,$),V-=te,F+=te,re-=te,$+=te,y.length-=te;break}y.mode=12;break;case 17:for(;P<14;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}if(y.nlen=257+(31&A),A>>>=5,P-=5,y.ndist=1+(31&A),A>>>=5,P-=5,y.ncode=4+(15&A),A>>>=4,P-=4,286<y.nlen||30<y.ndist){C.msg="too many length or distance symbols",y.mode=30;break}y.have=0,y.mode=18;case 18:for(;y.have<y.ncode;){for(;P<3;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}y.lens[Y[y.have++]]=7&A,A>>>=3,P-=3}for(;y.have<19;)y.lens[Y[y.have++]]=0;if(y.lencode=y.lendyn,y.lenbits=7,W={bits:y.lenbits},K=c(0,y.lens,0,19,y.lencode,0,y.work,W),y.lenbits=W.bits,K){C.msg="invalid code lengths set",y.mode=30;break}y.have=0,y.mode=19;case 19:for(;y.have<y.nlen+y.ndist;){for(;ue=(j=y.lencode[A&(1<<y.lenbits)-1])>>>16&255,ae=65535&j,!((ie=j>>>24)<=P);){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}if(ae<16)A>>>=ie,P-=ie,y.lens[y.have++]=ae;else{if(ae===16){for(T=ie+2;P<T;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}if(A>>>=ie,P-=ie,y.have===0){C.msg="invalid bit length repeat",y.mode=30;break}x=y.lens[y.have-1],te=3+(3&A),A>>>=2,P-=2}else if(ae===17){for(T=ie+3;P<T;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}P-=ie,x=0,te=3+(7&(A>>>=ie)),A>>>=3,P-=3}else{for(T=ie+7;P<T;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}P-=ie,x=0,te=11+(127&(A>>>=ie)),A>>>=7,P-=7}if(y.have+te>y.nlen+y.ndist){C.msg="invalid bit length repeat",y.mode=30;break}for(;te--;)y.lens[y.have++]=x}}if(y.mode===30)break;if(y.lens[256]===0){C.msg="invalid code -- missing end-of-block",y.mode=30;break}if(y.lenbits=9,W={bits:y.lenbits},K=c(d,y.lens,0,y.nlen,y.lencode,0,y.work,W),y.lenbits=W.bits,K){C.msg="invalid literal/lengths set",y.mode=30;break}if(y.distbits=6,y.distcode=y.distdyn,W={bits:y.distbits},K=c(f,y.lens,y.nlen,y.ndist,y.distcode,0,y.work,W),y.distbits=W.bits,K){C.msg="invalid distances set",y.mode=30;break}if(y.mode=20,M===6)break e;case 20:y.mode=21;case 21:if(6<=V&&258<=re){C.next_out=$,C.avail_out=re,C.next_in=F,C.avail_in=V,y.hold=A,y.bits=P,l(C,G),$=C.next_out,Q=C.output,re=C.avail_out,F=C.next_in,L=C.input,V=C.avail_in,A=y.hold,P=y.bits,y.mode===12&&(y.back=-1);break}for(y.back=0;ue=(j=y.lencode[A&(1<<y.lenbits)-1])>>>16&255,ae=65535&j,!((ie=j>>>24)<=P);){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}if(ue&&(240&ue)==0){for(pe=ie,ve=ue,_e=ae;ue=(j=y.lencode[_e+((A&(1<<pe+ve)-1)>>pe)])>>>16&255,ae=65535&j,!(pe+(ie=j>>>24)<=P);){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}A>>>=pe,P-=pe,y.back+=pe}if(A>>>=ie,P-=ie,y.back+=ie,y.length=ae,ue===0){y.mode=26;break}if(32&ue){y.back=-1,y.mode=12;break}if(64&ue){C.msg="invalid literal/length code",y.mode=30;break}y.extra=15&ue,y.mode=22;case 22:if(y.extra){for(T=y.extra;P<T;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}y.length+=A&(1<<y.extra)-1,A>>>=y.extra,P-=y.extra,y.back+=y.extra}y.was=y.length,y.mode=23;case 23:for(;ue=(j=y.distcode[A&(1<<y.distbits)-1])>>>16&255,ae=65535&j,!((ie=j>>>24)<=P);){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}if((240&ue)==0){for(pe=ie,ve=ue,_e=ae;ue=(j=y.distcode[_e+((A&(1<<pe+ve)-1)>>pe)])>>>16&255,ae=65535&j,!(pe+(ie=j>>>24)<=P);){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}A>>>=pe,P-=pe,y.back+=pe}if(A>>>=ie,P-=ie,y.back+=ie,64&ue){C.msg="invalid distance code",y.mode=30;break}y.offset=ae,y.extra=15&ue,y.mode=24;case 24:if(y.extra){for(T=y.extra;P<T;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}y.offset+=A&(1<<y.extra)-1,A>>>=y.extra,P-=y.extra,y.back+=y.extra}if(y.offset>y.dmax){C.msg="invalid distance too far back",y.mode=30;break}y.mode=25;case 25:if(re===0)break e;if(te=G-re,y.offset>te){if((te=y.offset-te)>y.whave&&y.sane){C.msg="invalid distance too far back",y.mode=30;break}ce=te>y.wnext?(te-=y.wnext,y.wsize-te):y.wnext-te,te>y.length&&(te=y.length),q=y.window}else q=Q,ce=$-y.offset,te=y.length;for(re<te&&(te=re),re-=te,y.length-=te;Q[$++]=q[ce++],--te;);y.length===0&&(y.mode=21);break;case 26:if(re===0)break e;Q[$++]=y.length,re--,y.mode=21;break;case 27:if(y.wrap){for(;P<32;){if(V===0)break e;V--,A|=L[F++]<<P,P+=8}if(G-=re,C.total_out+=G,y.total+=G,G&&(C.adler=y.check=y.flags?a(y.check,Q,G,$-G):s(y.check,Q,G,$-G)),G=re,(y.flags?A:b(A))!==y.check){C.msg="incorrect data check",y.mode=30;break}P=A=0}y.mode=28;case 28:if(y.wrap&&y.flags){for(;P<32;){if(V===0)break e;V--,A+=L[F++]<<P,P+=8}if(A!==(4294967295&y.total)){C.msg="incorrect length check",y.mode=30;break}P=A=0}y.mode=29;case 29:K=1;break e;case 30:K=-3;break e;case 31:return-4;case 32:default:return p}return C.next_out=$,C.avail_out=re,C.next_in=F,C.avail_in=V,y.hold=A,y.bits=P,(y.wsize||G!==C.avail_out&&y.mode<30&&(y.mode<27||M!==4))&&H(C,C.output,C.next_out,G-C.avail_out)?(y.mode=31,-4):(J-=C.avail_in,G-=C.avail_out,C.total_in+=J,C.total_out+=G,y.total+=G,y.wrap&&G&&(C.adler=y.check=y.flags?a(y.check,Q,G,C.next_out-G):s(y.check,Q,G,C.next_out-G)),C.data_type=y.bits+(y.last?64:0)+(y.mode===12?128:0)+(y.mode===20||y.mode===15?256:0),(J==0&&G===0||M===4)&&K===m&&(K=-5),K)},o.inflateEnd=function(C){if(!C||!C.state)return p;var M=C.state;return M.window&&(M.window=null),C.state=null,m},o.inflateGetHeader=function(C,M){var y;return C&&C.state?(2&(y=C.state).wrap)==0?p:((y.head=M).done=!1,m):p},o.inflateSetDictionary=function(C,M){var y,L=M.length;return C&&C.state?(y=C.state).wrap!==0&&y.mode!==11?p:y.mode===11&&s(1,M,L,0)!==y.check?-3:H(C,M,L,L)?(y.mode=31,-4):(y.havedict=1,m):p},o.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(r,n,o){var i=r("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],l=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];n.exports=function(d,f,m,p,w,u,g,b){var v,k,_,S,O,z,I,D,U,H=b.bits,C=0,M=0,y=0,L=0,Q=0,F=0,$=0,V=0,re=0,A=0,P=null,J=0,G=new i.Buf16(16),te=new i.Buf16(16),ce=null,q=0;for(C=0;C<=15;C++)G[C]=0;for(M=0;M<p;M++)G[f[m+M]]++;for(Q=H,L=15;1<=L&&G[L]===0;L--);if(L<Q&&(Q=L),L===0)return w[u++]=20971520,w[u++]=20971520,b.bits=1,0;for(y=1;y<L&&G[y]===0;y++);for(Q<y&&(Q=y),C=V=1;C<=15;C++)if(V<<=1,(V-=G[C])<0)return-1;if(0<V&&(d===0||L!==1))return-1;for(te[1]=0,C=1;C<15;C++)te[C+1]=te[C]+G[C];for(M=0;M<p;M++)f[m+M]!==0&&(g[te[f[m+M]]++]=M);if(z=d===0?(P=ce=g,19):d===1?(P=s,J-=257,ce=a,q-=257,256):(P=l,ce=c,-1),C=y,O=u,$=M=A=0,_=-1,S=(re=1<<(F=Q))-1,d===1&&852<re||d===2&&592<re)return 1;for(;;){for(I=C-$,U=g[M]<z?(D=0,g[M]):g[M]>z?(D=ce[q+g[M]],P[J+g[M]]):(D=96,0),v=1<<C-$,y=k=1<<F;w[O+(A>>$)+(k-=v)]=I<<24|D<<16|U|0,k!==0;);for(v=1<<C-1;A&v;)v>>=1;if(v!==0?(A&=v-1,A+=v):A=0,M++,--G[C]==0){if(C===L)break;C=f[m+g[M]]}if(Q<C&&(A&S)!==_){for($===0&&($=Q),O+=y,V=1<<(F=C-$);F+$<L&&!((V-=G[F+$])<=0);)F++,V<<=1;if(re+=1<<F,d===1&&852<re||d===2&&592<re)return 1;w[_=A&S]=Q<<24|F<<16|O-u|0}}return A!==0&&(w[O+A]=C-$<<24|64<<16|0),b.bits=Q,0}},{"../utils/common":41}],51:[function(r,n,o){n.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(r,n,o){var i=r("../utils/common"),s=0,a=1;function l(j){for(var R=j.length;0<=--R;)j[R]=0}var c=0,d=29,f=256,m=f+1+d,p=30,w=19,u=2*m+1,g=15,b=16,v=7,k=256,_=16,S=17,O=18,z=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],I=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],U=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],H=new Array(2*(m+2));l(H);var C=new Array(2*p);l(C);var M=new Array(512);l(M);var y=new Array(256);l(y);var L=new Array(d);l(L);var Q,F,$,V=new Array(p);function re(j,R,Y,X,B){this.static_tree=j,this.extra_bits=R,this.extra_base=Y,this.elems=X,this.max_length=B,this.has_stree=j&&j.length}function A(j,R){this.dyn_tree=j,this.max_code=0,this.stat_desc=R}function P(j){return j<256?M[j]:M[256+(j>>>7)]}function J(j,R){j.pending_buf[j.pending++]=255&R,j.pending_buf[j.pending++]=R>>>8&255}function G(j,R,Y){j.bi_valid>b-Y?(j.bi_buf|=R<<j.bi_valid&65535,J(j,j.bi_buf),j.bi_buf=R>>b-j.bi_valid,j.bi_valid+=Y-b):(j.bi_buf|=R<<j.bi_valid&65535,j.bi_valid+=Y)}function te(j,R,Y){G(j,Y[2*R],Y[2*R+1])}function ce(j,R){for(var Y=0;Y|=1&j,j>>>=1,Y<<=1,0<--R;);return Y>>>1}function q(j,R,Y){var X,B,ne=new Array(g+1),fe=0;for(X=1;X<=g;X++)ne[X]=fe=fe+Y[X-1]<<1;for(B=0;B<=R;B++){var se=j[2*B+1];se!==0&&(j[2*B]=ce(ne[se]++,se))}}function ie(j){var R;for(R=0;R<m;R++)j.dyn_ltree[2*R]=0;for(R=0;R<p;R++)j.dyn_dtree[2*R]=0;for(R=0;R<w;R++)j.bl_tree[2*R]=0;j.dyn_ltree[2*k]=1,j.opt_len=j.static_len=0,j.last_lit=j.matches=0}function ue(j){8<j.bi_valid?J(j,j.bi_buf):0<j.bi_valid&&(j.pending_buf[j.pending++]=j.bi_buf),j.bi_buf=0,j.bi_valid=0}function ae(j,R,Y,X){var B=2*R,ne=2*Y;return j[B]<j[ne]||j[B]===j[ne]&&X[R]<=X[Y]}function pe(j,R,Y){for(var X=j.heap[Y],B=Y<<1;B<=j.heap_len&&(B<j.heap_len&&ae(R,j.heap[B+1],j.heap[B],j.depth)&&B++,!ae(R,X,j.heap[B],j.depth));)j.heap[Y]=j.heap[B],Y=B,B<<=1;j.heap[Y]=X}function ve(j,R,Y){var X,B,ne,fe,se=0;if(j.last_lit!==0)for(;X=j.pending_buf[j.d_buf+2*se]<<8|j.pending_buf[j.d_buf+2*se+1],B=j.pending_buf[j.l_buf+se],se++,X===0?te(j,B,R):(te(j,(ne=y[B])+f+1,R),(fe=z[ne])!==0&&G(j,B-=L[ne],fe),te(j,ne=P(--X),Y),(fe=I[ne])!==0&&G(j,X-=V[ne],fe)),se<j.last_lit;);te(j,k,R)}function _e(j,R){var Y,X,B,ne=R.dyn_tree,fe=R.stat_desc.static_tree,se=R.stat_desc.has_stree,Z=R.stat_desc.elems,de=-1;for(j.heap_len=0,j.heap_max=u,Y=0;Y<Z;Y++)ne[2*Y]!==0?(j.heap[++j.heap_len]=de=Y,j.depth[Y]=0):ne[2*Y+1]=0;for(;j.heap_len<2;)ne[2*(B=j.heap[++j.heap_len]=de<2?++de:0)]=1,j.depth[B]=0,j.opt_len--,se&&(j.static_len-=fe[2*B+1]);for(R.max_code=de,Y=j.heap_len>>1;1<=Y;Y--)pe(j,ne,Y);for(B=Z;Y=j.heap[1],j.heap[1]=j.heap[j.heap_len--],pe(j,ne,1),X=j.heap[1],j.heap[--j.heap_max]=Y,j.heap[--j.heap_max]=X,ne[2*B]=ne[2*Y]+ne[2*X],j.depth[B]=(j.depth[Y]>=j.depth[X]?j.depth[Y]:j.depth[X])+1,ne[2*Y+1]=ne[2*X+1]=B,j.heap[1]=B++,pe(j,ne,1),2<=j.heap_len;);j.heap[--j.heap_max]=j.heap[1],(function(le,we){var ee,oe,ge,be,xe,je,Se=we.dyn_tree,Me=we.max_code,pt=we.stat_desc.static_tree,ki=we.stat_desc.has_stree,_i=we.stat_desc.extra_bits,eo=we.stat_desc.extra_base,Ie=we.stat_desc.max_length,Fe=0;for(be=0;be<=g;be++)le.bl_count[be]=0;for(Se[2*le.heap[le.heap_max]+1]=0,ee=le.heap_max+1;ee<u;ee++)Ie<(be=Se[2*Se[2*(oe=le.heap[ee])+1]+1]+1)&&(be=Ie,Fe++),Se[2*oe+1]=be,Me<oe||(le.bl_count[be]++,xe=0,eo<=oe&&(xe=_i[oe-eo]),je=Se[2*oe],le.opt_len+=je*(be+xe),ki&&(le.static_len+=je*(pt[2*oe+1]+xe)));if(Fe!==0){do{for(be=Ie-1;le.bl_count[be]===0;)be--;le.bl_count[be]--,le.bl_count[be+1]+=2,le.bl_count[Ie]--,Fe-=2}while(0<Fe);for(be=Ie;be!==0;be--)for(oe=le.bl_count[be];oe!==0;)Me<(ge=le.heap[--ee])||(Se[2*ge+1]!==be&&(le.opt_len+=(be-Se[2*ge+1])*Se[2*ge],Se[2*ge+1]=be),oe--)}})(j,R),q(ne,de,j.bl_count)}function x(j,R,Y){var X,B,ne=-1,fe=R[1],se=0,Z=7,de=4;for(fe===0&&(Z=138,de=3),R[2*(Y+1)+1]=65535,X=0;X<=Y;X++)B=fe,fe=R[2*(X+1)+1],++se<Z&&B===fe||(se<de?j.bl_tree[2*B]+=se:B!==0?(B!==ne&&j.bl_tree[2*B]++,j.bl_tree[2*_]++):se<=10?j.bl_tree[2*S]++:j.bl_tree[2*O]++,ne=B,de=(se=0)===fe?(Z=138,3):B===fe?(Z=6,3):(Z=7,4))}function K(j,R,Y){var X,B,ne=-1,fe=R[1],se=0,Z=7,de=4;for(fe===0&&(Z=138,de=3),X=0;X<=Y;X++)if(B=fe,fe=R[2*(X+1)+1],!(++se<Z&&B===fe)){if(se<de)for(;te(j,B,j.bl_tree),--se!=0;);else B!==0?(B!==ne&&(te(j,B,j.bl_tree),se--),te(j,_,j.bl_tree),G(j,se-3,2)):se<=10?(te(j,S,j.bl_tree),G(j,se-3,3)):(te(j,O,j.bl_tree),G(j,se-11,7));ne=B,de=(se=0)===fe?(Z=138,3):B===fe?(Z=6,3):(Z=7,4)}}l(V);var W=!1;function T(j,R,Y,X){G(j,(c<<1)+(X?1:0),3),(function(B,ne,fe,se){ue(B),J(B,fe),J(B,~fe),i.arraySet(B.pending_buf,B.window,ne,fe,B.pending),B.pending+=fe})(j,R,Y)}o._tr_init=function(j){W||((function(){var R,Y,X,B,ne,fe=new Array(g+1);for(B=X=0;B<d-1;B++)for(L[B]=X,R=0;R<1<<z[B];R++)y[X++]=B;for(y[X-1]=B,B=ne=0;B<16;B++)for(V[B]=ne,R=0;R<1<<I[B];R++)M[ne++]=B;for(ne>>=7;B<p;B++)for(V[B]=ne<<7,R=0;R<1<<I[B]-7;R++)M[256+ne++]=B;for(Y=0;Y<=g;Y++)fe[Y]=0;for(R=0;R<=143;)H[2*R+1]=8,R++,fe[8]++;for(;R<=255;)H[2*R+1]=9,R++,fe[9]++;for(;R<=279;)H[2*R+1]=7,R++,fe[7]++;for(;R<=287;)H[2*R+1]=8,R++,fe[8]++;for(q(H,m+1,fe),R=0;R<p;R++)C[2*R+1]=5,C[2*R]=ce(R,5);Q=new re(H,z,f+1,m,g),F=new re(C,I,0,p,g),$=new re(new Array(0),D,0,w,v)})(),W=!0),j.l_desc=new A(j.dyn_ltree,Q),j.d_desc=new A(j.dyn_dtree,F),j.bl_desc=new A(j.bl_tree,$),j.bi_buf=0,j.bi_valid=0,ie(j)},o._tr_stored_block=T,o._tr_flush_block=function(j,R,Y,X){var B,ne,fe=0;0<j.level?(j.strm.data_type===2&&(j.strm.data_type=(function(se){var Z,de=4093624447;for(Z=0;Z<=31;Z++,de>>>=1)if(1&de&&se.dyn_ltree[2*Z]!==0)return s;if(se.dyn_ltree[18]!==0||se.dyn_ltree[20]!==0||se.dyn_ltree[26]!==0)return a;for(Z=32;Z<f;Z++)if(se.dyn_ltree[2*Z]!==0)return a;return s})(j)),_e(j,j.l_desc),_e(j,j.d_desc),fe=(function(se){var Z;for(x(se,se.dyn_ltree,se.l_desc.max_code),x(se,se.dyn_dtree,se.d_desc.max_code),_e(se,se.bl_desc),Z=w-1;3<=Z&&se.bl_tree[2*U[Z]+1]===0;Z--);return se.opt_len+=3*(Z+1)+5+5+4,Z})(j),B=j.opt_len+3+7>>>3,(ne=j.static_len+3+7>>>3)<=B&&(B=ne)):B=ne=Y+5,Y+4<=B&&R!==-1?T(j,R,Y,X):j.strategy===4||ne===B?(G(j,2+(X?1:0),3),ve(j,H,C)):(G(j,4+(X?1:0),3),(function(se,Z,de,le){var we;for(G(se,Z-257,5),G(se,de-1,5),G(se,le-4,4),we=0;we<le;we++)G(se,se.bl_tree[2*U[we]+1],3);K(se,se.dyn_ltree,Z-1),K(se,se.dyn_dtree,de-1)})(j,j.l_desc.max_code+1,j.d_desc.max_code+1,fe+1),ve(j,j.dyn_ltree,j.dyn_dtree)),ie(j),X&&ue(j)},o._tr_tally=function(j,R,Y){return j.pending_buf[j.d_buf+2*j.last_lit]=R>>>8&255,j.pending_buf[j.d_buf+2*j.last_lit+1]=255&R,j.pending_buf[j.l_buf+j.last_lit]=255&Y,j.last_lit++,R===0?j.dyn_ltree[2*Y]++:(j.matches++,R--,j.dyn_ltree[2*(y[Y]+f+1)]++,j.dyn_dtree[2*P(R)]++),j.last_lit===j.lit_bufsize-1},o._tr_align=function(j){G(j,2,3),te(j,k,H),(function(R){R.bi_valid===16?(J(R,R.bi_buf),R.bi_buf=0,R.bi_valid=0):8<=R.bi_valid&&(R.pending_buf[R.pending++]=255&R.bi_buf,R.bi_buf>>=8,R.bi_valid-=8)})(j)}},{"../utils/common":41}],53:[function(r,n,o){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,n,o){(function(i){(function(s,a){if(!s.setImmediate){var l,c,d,f,m=1,p={},w=!1,u=s.document,g=Object.getPrototypeOf&&Object.getPrototypeOf(s);g=g&&g.setTimeout?g:s,l={}.toString.call(s.process)==="[object process]"?function(_){process.nextTick(function(){v(_)})}:(function(){if(s.postMessage&&!s.importScripts){var _=!0,S=s.onmessage;return s.onmessage=function(){_=!1},s.postMessage("","*"),s.onmessage=S,_}})()?(f="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",k,!1):s.attachEvent("onmessage",k),function(_){s.postMessage(f+_,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(_){v(_.data)},function(_){d.port2.postMessage(_)}):u&&"onreadystatechange"in u.createElement("script")?(c=u.documentElement,function(_){var S=u.createElement("script");S.onreadystatechange=function(){v(_),S.onreadystatechange=null,c.removeChild(S),S=null},c.appendChild(S)}):function(_){setTimeout(v,0,_)},g.setImmediate=function(_){typeof _!="function"&&(_=new Function(""+_));for(var S=new Array(arguments.length-1),O=0;O<S.length;O++)S[O]=arguments[O+1];var z={callback:_,args:S};return p[m]=z,l(m),m++},g.clearImmediate=b}function b(_){delete p[_]}function v(_){if(w)setTimeout(v,0,_);else{var S=p[_];if(S){w=!0;try{(function(O){var z=O.callback,I=O.args;switch(I.length){case 0:z();break;case 1:z(I[0]);break;case 2:z(I[0],I[1]);break;case 3:z(I[0],I[1],I[2]);break;default:z.apply(a,I)}})(S)}finally{b(_),w=!1}}}}function k(_){_.source===s&&typeof _.data=="string"&&_.data.indexOf(f)===0&&v(+_.data.slice(f.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof gt<"u"?gt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(to)),to.exports}var Ac=jc();const Tc=zc(Ac);var Vr={exports:{}},Oc=Vr.exports,zi;function Ic(){return zi||(zi=1,(function(e,t){(function(r,n){n()})(Oc,function(){function r(c,d){return typeof d>"u"?d={autoBom:!1}:typeof d!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),d={autoBom:!d}),d.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function n(c,d,f){var m=new XMLHttpRequest;m.open("GET",c),m.responseType="blob",m.onload=function(){l(m.response,d,f)},m.onerror=function(){console.error("could not download file")},m.send()}function o(c){var d=new XMLHttpRequest;d.open("HEAD",c,!1);try{d.send()}catch{}return 200<=d.status&&299>=d.status}function i(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(d)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof gt=="object"&&gt.global===gt?gt:void 0,a=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,d,f){var m=s.URL||s.webkitURL,p=document.createElement("a");d=d||c.name||"download",p.download=d,p.rel="noopener",typeof c=="string"?(p.href=c,p.origin===location.origin?i(p):o(p.href)?n(c,d,f):i(p,p.target="_blank")):(p.href=m.createObjectURL(c),setTimeout(function(){m.revokeObjectURL(p.href)},4e4),setTimeout(function(){i(p)},0))}:"msSaveOrOpenBlob"in navigator?function(c,d,f){if(d=d||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(r(c,f),d);else if(o(c))n(c,d,f);else{var m=document.createElement("a");m.href=c,m.target="_blank",setTimeout(function(){i(m)})}}:function(c,d,f,m){if(m=m||open("","_blank"),m&&(m.document.title=m.document.body.innerText="downloading..."),typeof c=="string")return n(c,d,f);var p=c.type==="application/octet-stream",w=/constructor/i.test(s.HTMLElement)||s.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||p&&w||a)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var k=g.result;k=u?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=k:location=k,m=null},g.readAsDataURL(c)}else{var b=s.URL||s.webkitURL,v=b.createObjectURL(c);m?m.location=v:location.href=v,m=null,setTimeout(function(){b.revokeObjectURL(v)},4e4)}});s.saveAs=l.saveAs=l,e.exports=l})})(Vr)),Vr.exports}var ji=Ic();const Ai=async(e,t)=>{const r=new Tc,n=r.folder("config");n==null||n.file("site.json",JSON.stringify(e.site,null,2)),n==null||n.file("theme.json",JSON.stringify(e.theme,null,2)),n==null||n.file("menu.json",JSON.stringify(e.menu,null,2));const o=r.folder("pages");o==null||o.file(`${t}.json`,JSON.stringify(e.page,null,2));const i=await r.generateAsync({type:"blob"});ji.saveAs(i,`jsonpages-project-${t}-${Date.now()}.zip`)},Ti=(e,t,r)=>{const{pages:n,...o}=e.site,i={page:e.page,site:o,menu:e.menu,theme:e.theme},a=`<script id="jp-baked-state" type="application/json">${JSON.stringify(i)}<\/script>`,l=r.replace("</head>",`${a}</head>`),c=new Blob([`<!DOCTYPE html>${l}`],{type:"text/html;charset=utf-8"});ji.saveAs(c,`${t}.html`)};function Oi(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Oi(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Pc(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Oi(e))&&(n&&(n+=" "),n+=t);return n}const Dc=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},Rc=(e,t)=>({classGroupId:e,validator:t}),Ii=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Zr="-",Pi=[],Mc="arbitrary..",Lc=e=>{const t=Bc(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Fc(s);const a=s.split(Zr),l=a[0]===""&&a.length>1?1:0;return Di(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],c=r[s];return l?c?Dc(c,l):l:c||Pi}return r[s]||Pi}}},Di=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const c=Di(e,t+1,i);if(c)return c}const s=r.validators;if(s===null)return;const a=t===0?e.join(Zr):e.slice(t).join(Zr),l=s.length;for(let c=0;c<l;c++){const d=s[c];if(d.validator(a))return d.classGroupId}},Fc=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Mc+n:void 0})(),Bc=e=>{const{theme:t,classGroups:r}=e;return Uc(r,t)},Uc=(e,t)=>{const r=Ii();for(const n in e){const o=e[n];ro(o,r,n,t)}return r},ro=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];$c(s,t,r,n)}},$c=(e,t,r,n)=>{if(typeof e=="string"){Wc(e,t,r);return}if(typeof e=="function"){Hc(e,t,r,n);return}Vc(e,t,r,n)},Wc=(e,t,r)=>{const n=e===""?t:Ri(t,e);n.classGroupId=r},Hc=(e,t,r,n)=>{if(Zc(e)){ro(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Rc(r,e))},Vc=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];ro(l,Ri(t,a),r,n)}},Ri=(e,t)=>{let r=e;const n=t.split(Zr),o=n.length;for(let i=0;i<o;i++){const s=n[i];let a=r.nextPart.get(s);a||(a=Ii(),r.nextPart.set(s,a)),r=a}return r},Zc=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Gc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(i,s)=>{r[i]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set(i,s){i in r?r[i]=s:o(i,s)}}},no="!",Mi=":",Kc=[],Li=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Yc=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const i=[];let s=0,a=0,l=0,c;const d=o.length;for(let u=0;u<d;u++){const g=o[u];if(s===0&&a===0){if(g===Mi){i.push(o.slice(l,u)),l=u+1;continue}if(g==="/"){c=u;continue}}g==="["?s++:g==="]"?s--:g==="("?a++:g===")"&&a--}const f=i.length===0?o:o.slice(l);let m=f,p=!1;f.endsWith(no)?(m=f.slice(0,-1),p=!0):f.startsWith(no)&&(m=f.slice(1),p=!0);const w=c&&c>l?c-l:void 0;return Li(i,p,m,w)};if(t){const o=t+Mi,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):Li(Kc,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},qc=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let i=0;i<r.length;i++){const s=r[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},Xc=e=>({cache:Gc(e.cacheSize),parseClassName:Yc(e),sortModifiers:qc(e),...Lc(e)}),Jc=/\s+/,Qc=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(Jc);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{isExternal:f,modifiers:m,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:u}=r(d);if(f){l=d+(l.length>0?" "+l:l);continue}let g=!!u,b=n(g?w.substring(0,u):w);if(!b){if(!g){l=d+(l.length>0?" "+l:l);continue}if(b=n(w),!b){l=d+(l.length>0?" "+l:l);continue}g=!1}const v=m.length===0?"":m.length===1?m[0]:i(m).join(":"),k=p?v+no:v,_=k+b;if(s.indexOf(_)>-1)continue;s.push(_);const S=o(b,g);for(let O=0;O<S.length;++O){const z=S[O];s.push(k+z)}l=d+(l.length>0?" "+l:l)}return l},ed=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Fi(r))&&(o&&(o+=" "),o+=n);return o},Fi=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Fi(e[n]))&&(r&&(r+=" "),r+=t);return r},td=(e,...t)=>{let r,n,o,i;const s=l=>{const c=t.reduce((d,f)=>f(d),e());return r=Xc(c),n=r.cache.get,o=r.cache.set,i=a,a(l)},a=l=>{const c=n(l);if(c)return c;const d=Qc(l,r);return o(l,d),d};return i=s,(...l)=>i(ed(...l))},rd=[],De=e=>{const t=r=>r[e]||rd;return t.isThemeGetter=!0,t},Bi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ui=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nd=/^\d+\/\d+$/,od=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,id=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ad=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ld=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rt=e=>nd.test(e),ke=e=>!!e&&!Number.isNaN(Number(e)),bt=e=>!!e&&Number.isInteger(Number(e)),oo=e=>e.endsWith("%")&&ke(e.slice(0,-1)),dt=e=>od.test(e),cd=()=>!0,dd=e=>id.test(e)&&!sd.test(e),$i=()=>!1,ud=e=>ad.test(e),fd=e=>ld.test(e),pd=e=>!he(e)&&!me(e),hd=e=>Mt(e,Gi,$i),he=e=>Bi.test(e),jt=e=>Mt(e,Ki,dd),io=e=>Mt(e,xd,ke),Wi=e=>Mt(e,Vi,$i),md=e=>Mt(e,Zi,fd),Gr=e=>Mt(e,Yi,ud),me=e=>Ui.test(e),cr=e=>Lt(e,Ki),gd=e=>Lt(e,wd),Hi=e=>Lt(e,Vi),bd=e=>Lt(e,Gi),vd=e=>Lt(e,Zi),Kr=e=>Lt(e,Yi,!0),Mt=(e,t,r)=>{const n=Bi.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Lt=(e,t,r=!1)=>{const n=Ui.exec(e);return n?n[1]?t(n[1]):r:!1},Vi=e=>e==="position"||e==="percentage",Zi=e=>e==="image"||e==="url",Gi=e=>e==="length"||e==="size"||e==="bg-size",Ki=e=>e==="length",xd=e=>e==="number",wd=e=>e==="family-name",Yi=e=>e==="shadow",yd=td(()=>{const e=De("color"),t=De("font"),r=De("text"),n=De("font-weight"),o=De("tracking"),i=De("leading"),s=De("breakpoint"),a=De("container"),l=De("spacing"),c=De("radius"),d=De("shadow"),f=De("inset-shadow"),m=De("text-shadow"),p=De("drop-shadow"),w=De("blur"),u=De("perspective"),g=De("aspect"),b=De("ease"),v=De("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[..._(),me,he],O=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],I=()=>[me,he,l],D=()=>[Rt,"full","auto",...I()],U=()=>[bt,"none","subgrid",me,he],H=()=>["auto",{span:["full",bt,me,he]},bt,me,he],C=()=>[bt,"auto",me,he],M=()=>["auto","min","max","fr",me,he],y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],L=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...I()],F=()=>[Rt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],$=()=>[e,me,he],V=()=>[..._(),Hi,Wi,{position:[me,he]}],re=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",bd,hd,{size:[me,he]}],P=()=>[oo,cr,jt],J=()=>["","none","full",c,me,he],G=()=>["",ke,cr,jt],te=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],q=()=>[ke,oo,Hi,Wi],ie=()=>["","none",w,me,he],ue=()=>["none",ke,me,he],ae=()=>["none",ke,me,he],pe=()=>[ke,me,he],ve=()=>[Rt,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[dt],breakpoint:[dt],color:[cd],container:[dt],"drop-shadow":[dt],ease:["in","out","in-out"],font:[pd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[dt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[dt],shadow:[dt],spacing:["px",ke],text:[dt],"text-shadow":[dt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rt,he,me,g]}],container:["container"],columns:[{columns:[ke,he,me,a]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{start:D()}],end:[{end:D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[bt,"auto",me,he]}],basis:[{basis:[Rt,"full","auto",a,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ke,Rt,"auto","initial","none",he]}],grow:[{grow:["",ke,me,he]}],shrink:[{shrink:["",ke,me,he]}],order:[{order:[bt,"first","last","none",me,he]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...y(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...y()]}],"align-items":[{items:[...L(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...L(),{baseline:["","last"]}]}],"place-content":[{"place-content":y()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:F()}],w:[{w:[a,"screen",...F()]}],"min-w":[{"min-w":[a,"screen","none",...F()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...F()]}],h:[{h:["screen","lh",...F()]}],"min-h":[{"min-h":["screen","lh","none",...F()]}],"max-h":[{"max-h":["screen","lh",...F()]}],"font-size":[{text:["base",r,cr,jt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,me,io]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",oo,he]}],"font-family":[{font:[gd,he,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,me,he]}],"line-clamp":[{"line-clamp":[ke,"none",me,io]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",me,he]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",me,he]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[ke,"from-font","auto",me,jt]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[ke,"auto",me,he]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me,he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me,he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bt,me,he],radial:["",me,he],conic:[bt,me,he]},vd,md]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ke,me,he]}],"outline-w":[{outline:["",ke,cr,jt]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",d,Kr,Gr]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",f,Kr,Gr]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[ke,jt]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",m,Kr,Gr]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[ke,me,he]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":q()}],"mask-image-linear-to-pos":[{"mask-linear-to":q()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":q()}],"mask-image-t-to-pos":[{"mask-t-to":q()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":q()}],"mask-image-r-to-pos":[{"mask-r-to":q()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":q()}],"mask-image-b-to-pos":[{"mask-b-to":q()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":q()}],"mask-image-l-to-pos":[{"mask-l-to":q()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":q()}],"mask-image-x-to-pos":[{"mask-x-to":q()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":q()}],"mask-image-y-to-pos":[{"mask-y-to":q()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[me,he]}],"mask-image-radial-from-pos":[{"mask-radial-from":q()}],"mask-image-radial-to-pos":[{"mask-radial-to":q()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":q()}],"mask-image-conic-to-pos":[{"mask-conic-to":q()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",me,he]}],filter:[{filter:["","none",me,he]}],blur:[{blur:ie()}],brightness:[{brightness:[ke,me,he]}],contrast:[{contrast:[ke,me,he]}],"drop-shadow":[{"drop-shadow":["","none",p,Kr,Gr]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",ke,me,he]}],"hue-rotate":[{"hue-rotate":[ke,me,he]}],invert:[{invert:["",ke,me,he]}],saturate:[{saturate:[ke,me,he]}],sepia:[{sepia:["",ke,me,he]}],"backdrop-filter":[{"backdrop-filter":["","none",me,he]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[ke,me,he]}],"backdrop-contrast":[{"backdrop-contrast":[ke,me,he]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ke,me,he]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ke,me,he]}],"backdrop-invert":[{"backdrop-invert":["",ke,me,he]}],"backdrop-opacity":[{"backdrop-opacity":[ke,me,he]}],"backdrop-saturate":[{"backdrop-saturate":[ke,me,he]}],"backdrop-sepia":[{"backdrop-sepia":["",ke,me,he]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",me,he]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ke,"initial",me,he]}],ease:[{ease:["linear","initial",b,me,he]}],delay:[{delay:[ke,me,he]}],animate:[{animate:["none",v,me,he]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[u,me,he]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[me,he,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me,he]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me,he]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[ke,cr,jt,io]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ye(...e){return yd(Pc(e))}var Yr={exports:{}},dr={};/**
1
+ (function(ae,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react"),require("react-router-dom"),require("zod"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-router-dom","zod","react-dom"],b):(ae=typeof globalThis<"u"?globalThis:ae||self,b(ae.OlonJsCore={},ae.React,ae.ReactRouterDOM,ae.z,ae.ReactDOM))})(this,(function(ae,b,Je,je,bt){"use strict";function Ai(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const g=Ai(b),Vr=Ai(bt);function Ti(e,t){return t.header!=null&&e["global-header"]!==!1}const ve={UPDATE_DRAFTS:"jsonpages:update-drafts",SYNC_SELECTION:"jsonpages:sync-selection",SECTION_SELECT:"jsonpages:section-select",INLINE_FIELD_UPDATE:"jsonpages:inline-field-update",INLINE_FLUSHED:"jsonpages:inline-flushed",REQUEST_SCROLL_TO_SECTION:"jsonpages:request-scroll-to-section",REQUEST_INLINE_FLUSH:"jsonpages:request-inline-flush",ACTIVE_SECTION_CHANGED:"jsonpages:active-section-changed",STAGE_READY:"jsonpages:stage-ready",WEBMCP_TOOL_CALL:"olonjs:webmcp:tool-call",WEBMCP_TOOL_RESULT:"olonjs:webmcp:tool-result"};function zi(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=zi(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Dc(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=zi(e))&&(n&&(n+=" "),n+=t);return n}const _c=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},Mc=(e,t)=>({classGroupId:e,validator:t}),Pi=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Kr="-",Oi=[],Rc="arbitrary..",Lc=e=>{const t=Fc(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return $c(s);const a=s.split(Kr),l=a[0]===""&&a.length>1?1:0;return Ii(a,l,t)},getConflictingClassGroupIds:(s,a)=>{if(a){const l=n[s],d=r[s];return l?d?_c(d,l):l:d||Oi}return r[s]||Oi}}},Ii=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],i=r.nextPart.get(o);if(i){const d=Ii(e,t+1,i);if(d)return d}const s=r.validators;if(s===null)return;const a=t===0?e.join(Kr):e.slice(t).join(Kr),l=s.length;for(let d=0;d<l;d++){const u=s[d];if(u.validator(a))return u.classGroupId}},$c=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Rc+n:void 0})(),Fc=e=>{const{theme:t,classGroups:r}=e;return Wc(r,t)},Wc=(e,t)=>{const r=Pi();for(const n in e){const o=e[n];to(o,r,n,t)}return r},to=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const s=e[i];Uc(s,t,r,n)}},Uc=(e,t,r,n)=>{if(typeof e=="string"){Bc(e,t,r);return}if(typeof e=="function"){Hc(e,t,r,n);return}Vc(e,t,r,n)},Bc=(e,t,r)=>{const n=e===""?t:Di(t,e);n.classGroupId=r},Hc=(e,t,r,n)=>{if(Kc(e)){to(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Mc(r,e))},Vc=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let s=0;s<i;s++){const[a,l]=o[s];to(l,Di(t,a),r,n)}},Di=(e,t)=>{let r=e;const n=t.split(Kr),o=n.length;for(let i=0;i<o;i++){const s=n[i];let a=r.nextPart.get(s);a||(a=Pi(),r.nextPart.set(s,a)),r=a}return r},Kc=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Gc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(i,s)=>{r[i]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let s=r[i];if(s!==void 0)return s;if((s=n[i])!==void 0)return o(i,s),s},set(i,s){i in r?r[i]=s:o(i,s)}}},ro="!",_i=":",Yc=[],Mi=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),qc=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const i=[];let s=0,a=0,l=0,d;const u=o.length;for(let m=0;m<u;m++){const v=o[m];if(s===0&&a===0){if(v===_i){i.push(o.slice(l,m)),l=m+1;continue}if(v==="/"){d=m;continue}}v==="["?s++:v==="]"?s--:v==="("?a++:v===")"&&a--}const f=i.length===0?o:o.slice(l);let h=f,p=!1;f.endsWith(ro)?(h=f.slice(0,-1),p=!0):f.startsWith(ro)&&(h=f.slice(1),p=!0);const w=d&&d>l?d-l:void 0;return Mi(i,p,h,w)};if(t){const o=t+_i,i=n;n=s=>s.startsWith(o)?i(s.slice(o.length)):Mi(Yc,!1,s,void 0,!0)}if(r){const o=n;n=i=>r({className:i,parseClassName:o})}return n},Xc=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let i=0;i<r.length;i++){const s=r[i],a=s[0]==="[",l=t.has(s);a||l?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(s)):o.push(s)}return o.length>0&&(o.sort(),n.push(...o)),n}},Jc=e=>({cache:Gc(e.cacheSize),parseClassName:qc(e),sortModifiers:Xc(e),...Lc(e)}),Zc=/\s+/,Qc=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],a=e.trim().split(Zc);let l="";for(let d=a.length-1;d>=0;d-=1){const u=a[d],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:w,maybePostfixModifierPosition:m}=r(u);if(f){l=u+(l.length>0?" "+l:l);continue}let v=!!m,y=n(v?w.substring(0,m):w);if(!y){if(!v){l=u+(l.length>0?" "+l:l);continue}if(y=n(w),!y){l=u+(l.length>0?" "+l:l);continue}v=!1}const k=h.length===0?"":h.length===1?h[0]:i(h).join(":"),x=p?k+ro:k,S=x+y;if(s.indexOf(S)>-1)continue;s.push(S);const C=o(y,v);for(let E=0;E<C.length;++E){const j=C[E];s.push(x+j)}l=u+(l.length>0?" "+l:l)}return l},ed=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Ri(r))&&(o&&(o+=" "),o+=n);return o},Ri=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ri(e[n]))&&(r&&(r+=" "),r+=t);return r},td=(e,...t)=>{let r,n,o,i;const s=l=>{const d=t.reduce((u,f)=>f(u),e());return r=Jc(d),n=r.cache.get,o=r.cache.set,i=a,a(l)},a=l=>{const d=n(l);if(d)return d;const u=Qc(l,r);return o(l,u),u};return i=s,(...l)=>i(ed(...l))},rd=[],Ae=e=>{const t=r=>r[e]||rd;return t.isThemeGetter=!0,t},Li=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,$i=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nd=/^\d+\/\d+$/,od=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,id=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ad=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ld=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$t=e=>nd.test(e),le=e=>!!e&&!Number.isNaN(Number(e)),vt=e=>!!e&&Number.isInteger(Number(e)),no=e=>e.endsWith("%")&&le(e.slice(0,-1)),ft=e=>od.test(e),cd=()=>!0,dd=e=>id.test(e)&&!sd.test(e),Fi=()=>!1,ud=e=>ad.test(e),fd=e=>ld.test(e),pd=e=>!V(e)&&!K(e),hd=e=>Ft(e,Vi,Fi),V=e=>Li.test(e),Pt=e=>Ft(e,Ki,dd),oo=e=>Ft(e,xd,le),Wi=e=>Ft(e,Bi,Fi),md=e=>Ft(e,Hi,fd),Gr=e=>Ft(e,Gi,ud),K=e=>$i.test(e),dr=e=>Wt(e,Ki),gd=e=>Wt(e,wd),Ui=e=>Wt(e,Bi),bd=e=>Wt(e,Vi),vd=e=>Wt(e,Hi),Yr=e=>Wt(e,Gi,!0),Ft=(e,t,r)=>{const n=Li.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Wt=(e,t,r=!1)=>{const n=$i.exec(e);return n?n[1]?t(n[1]):r:!1},Bi=e=>e==="position"||e==="percentage",Hi=e=>e==="image"||e==="url",Vi=e=>e==="length"||e==="size"||e==="bg-size",Ki=e=>e==="length",xd=e=>e==="number",wd=e=>e==="family-name",Gi=e=>e==="shadow",yd=td(()=>{const e=Ae("color"),t=Ae("font"),r=Ae("text"),n=Ae("font-weight"),o=Ae("tracking"),i=Ae("leading"),s=Ae("breakpoint"),a=Ae("container"),l=Ae("spacing"),d=Ae("radius"),u=Ae("shadow"),f=Ae("inset-shadow"),h=Ae("text-shadow"),p=Ae("drop-shadow"),w=Ae("blur"),m=Ae("perspective"),v=Ae("aspect"),y=Ae("ease"),k=Ae("animate"),x=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),K,V],E=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],N=()=>[K,V,l],_=()=>[$t,"full","auto",...N()],R=()=>[vt,"none","subgrid",K,V],I=()=>["auto",{span:["full",vt,K,V]},vt,K,V],L=()=>[vt,"auto",K,V],M=()=>["auto","min","max","fr",K,V],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],U=()=>["auto",...N()],B=()=>[$t,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],T=()=>[e,K,V],X=()=>[...S(),Ui,Wi,{position:[K,V]}],re=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",bd,hd,{size:[K,V]}],W=()=>[no,dr,Pt],q=()=>["","none","full",d,K,V],G=()=>["",le,dr,Pt],me=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>[le,no,Ui,Wi],J=()=>["","none",w,K,V],te=()=>["none",le,K,V],F=()=>["none",le,K,V],ne=()=>[le,K,V],Q=()=>[$t,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ft],breakpoint:[ft],color:[cd],container:[ft],"drop-shadow":[ft],ease:["in","out","in-out"],font:[pd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ft],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ft],shadow:[ft],spacing:["px",le],text:[ft],"text-shadow":[ft],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$t,V,K,v]}],container:["container"],columns:[{columns:[le,V,K,a]}],"break-after":[{"break-after":x()}],"break-before":[{"break-before":x()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{start:_()}],end:[{end:_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[vt,"auto",K,V]}],basis:[{basis:[$t,"full","auto",a,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[le,$t,"auto","initial","none",V]}],grow:[{grow:["",le,K,V]}],shrink:[{shrink:["",le,K,V]}],order:[{order:[vt,"first","last","none",K,V]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:I()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:I()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:U()}],mx:[{mx:U()}],my:[{my:U()}],ms:[{ms:U()}],me:[{me:U()}],mt:[{mt:U()}],mr:[{mr:U()}],mb:[{mb:U()}],ml:[{ml:U()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],w:[{w:[a,"screen",...B()]}],"min-w":[{"min-w":[a,"screen","none",...B()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",r,dr,Pt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,K,oo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",no,V]}],"font-family":[{font:[gd,V,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,K,V]}],"line-clamp":[{"line-clamp":[le,"none",K,oo]}],leading:[{leading:[i,...N()]}],"list-image":[{"list-image":["none",K,V]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",K,V]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...me(),"wavy"]}],"text-decoration-thickness":[{decoration:[le,"from-font","auto",K,Pt]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[le,"auto",K,V]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",K,V]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",K,V]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:X()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vt,K,V],radial:["",K,V],conic:[vt,K,V]},vd,md]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...me(),"hidden","none"]}],"divide-style":[{divide:[...me(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...me(),"none","hidden"]}],"outline-offset":[{"outline-offset":[le,K,V]}],"outline-w":[{outline:["",le,dr,Pt]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",u,Yr,Gr]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",f,Yr,Gr]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[le,Pt]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",h,Yr,Gr]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[le,K,V]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[le]}],"mask-image-linear-from-pos":[{"mask-linear-from":P()}],"mask-image-linear-to-pos":[{"mask-linear-to":P()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":P()}],"mask-image-t-to-pos":[{"mask-t-to":P()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":P()}],"mask-image-r-to-pos":[{"mask-r-to":P()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":P()}],"mask-image-b-to-pos":[{"mask-b-to":P()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":P()}],"mask-image-l-to-pos":[{"mask-l-to":P()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":P()}],"mask-image-x-to-pos":[{"mask-x-to":P()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":P()}],"mask-image-y-to-pos":[{"mask-y-to":P()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[K,V]}],"mask-image-radial-from-pos":[{"mask-radial-from":P()}],"mask-image-radial-to-pos":[{"mask-radial-to":P()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[le]}],"mask-image-conic-from-pos":[{"mask-conic-from":P()}],"mask-image-conic-to-pos":[{"mask-conic-to":P()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:X()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",K,V]}],filter:[{filter:["","none",K,V]}],blur:[{blur:J()}],brightness:[{brightness:[le,K,V]}],contrast:[{contrast:[le,K,V]}],"drop-shadow":[{"drop-shadow":["","none",p,Yr,Gr]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",le,K,V]}],"hue-rotate":[{"hue-rotate":[le,K,V]}],invert:[{invert:["",le,K,V]}],saturate:[{saturate:[le,K,V]}],sepia:[{sepia:["",le,K,V]}],"backdrop-filter":[{"backdrop-filter":["","none",K,V]}],"backdrop-blur":[{"backdrop-blur":J()}],"backdrop-brightness":[{"backdrop-brightness":[le,K,V]}],"backdrop-contrast":[{"backdrop-contrast":[le,K,V]}],"backdrop-grayscale":[{"backdrop-grayscale":["",le,K,V]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[le,K,V]}],"backdrop-invert":[{"backdrop-invert":["",le,K,V]}],"backdrop-opacity":[{"backdrop-opacity":[le,K,V]}],"backdrop-saturate":[{"backdrop-saturate":[le,K,V]}],"backdrop-sepia":[{"backdrop-sepia":["",le,K,V]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",K,V]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[le,"initial",K,V]}],ease:[{ease:["linear","initial",y,K,V]}],delay:[{delay:[le,K,V]}],animate:[{animate:["none",k,K,V]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,K,V]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:F()}],"scale-x":[{"scale-x":F()}],"scale-y":[{"scale-y":F()}],"scale-z":[{"scale-z":F()}],"scale-3d":["scale-3d"],skew:[{skew:ne()}],"skew-x":[{"skew-x":ne()}],"skew-y":[{"skew-y":ne()}],transform:[{transform:[K,V,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Q()}],"translate-x":[{"translate-x":Q()}],"translate-y":[{"translate-y":Q()}],"translate-z":[{"translate-z":Q()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",K,V]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",K,V]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[le,dr,Pt,oo]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function oe(...e){return yd(Dc(e))}var qr={exports:{}},ur={};/**
13
2
  * @license React
14
3
  * react-jsx-runtime.production.js
15
4
  *
@@ -17,7 +6,7 @@
17
6
  *
18
7
  * This source code is licensed under the MIT license found in the
19
8
  * LICENSE file in the root directory of this source tree.
20
- */var qi;function kd(){if(qi)return dr;qi=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,o,i){var s=null;if(i!==void 0&&(s=""+i),o.key!==void 0&&(s=""+o.key),"key"in o){i={};for(var a in o)a!=="key"&&(i[a]=o[a])}else i=o;return o=i.ref,{$$typeof:e,type:n,key:s,ref:o!==void 0?o:null,props:i}}return dr.Fragment=t,dr.jsx=r,dr.jsxs=r,dr}var ur={};/**
9
+ */var Yi;function kd(){if(Yi)return ur;Yi=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,o,i){var s=null;if(i!==void 0&&(s=""+i),o.key!==void 0&&(s=""+o.key),"key"in o){i={};for(var a in o)a!=="key"&&(i[a]=o[a])}else i=o;return o=i.ref,{$$typeof:e,type:n,key:s,ref:o!==void 0?o:null,props:i}}return ur.Fragment=t,ur.jsx=r,ur.jsxs=r,ur}var fr={};/**
21
10
  * @license React
22
11
  * react-jsx-runtime.development.js
23
12
  *
@@ -25,196 +14,181 @@
25
14
  *
26
15
  * This source code is licensed under the MIT license found in the
27
16
  * LICENSE file in the root directory of this source tree.
28
- */var Xi;function _d(){return Xi||(Xi=1,process.env.NODE_ENV!=="production"&&(function(){function e(A){if(A==null)return null;if(typeof A=="function")return A.$$typeof===H?null:A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case g:return"Fragment";case v:return"Profiler";case b:return"StrictMode";case O:return"Suspense";case z:return"SuspenseList";case U:return"Activity"}if(typeof A=="object")switch(typeof A.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),A.$$typeof){case u:return"Portal";case _:return A.displayName||"Context";case k:return(A._context.displayName||"Context")+".Consumer";case S:var P=A.render;return A=A.displayName,A||(A=P.displayName||P.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case I:return P=A.displayName||null,P!==null?P:e(A.type)||"Memo";case D:P=A._payload,A=A._init;try{return e(A(P))}catch{}}return null}function t(A){return""+A}function r(A){try{t(A);var P=!1}catch{P=!0}if(P){P=console;var J=P.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&A[Symbol.toStringTag]||A.constructor.name||"Object";return J.call(P,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),t(A)}}function n(A){if(A===g)return"<>";if(typeof A=="object"&&A!==null&&A.$$typeof===D)return"<...>";try{var P=e(A);return P?"<"+P+">":"<...>"}catch{return"<...>"}}function o(){var A=C.A;return A===null?null:A.getOwner()}function i(){return Error("react-stack-top-frame")}function s(A){if(M.call(A,"key")){var P=Object.getOwnPropertyDescriptor(A,"key").get;if(P&&P.isReactWarning)return!1}return A.key!==void 0}function a(A,P){function J(){Q||(Q=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",P))}J.isReactWarning=!0,Object.defineProperty(A,"key",{get:J,configurable:!0})}function l(){var A=e(this.type);return F[A]||(F[A]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),A=this.props.ref,A!==void 0?A:null}function c(A,P,J,G,te,ce){var q=J.ref;return A={$$typeof:w,type:A,key:P,props:J,_owner:G},(q!==void 0?q:null)!==null?Object.defineProperty(A,"ref",{enumerable:!1,get:l}):Object.defineProperty(A,"ref",{enumerable:!1,value:null}),A._store={},Object.defineProperty(A._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(A,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(A,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.defineProperty(A,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ce}),Object.freeze&&(Object.freeze(A.props),Object.freeze(A)),A}function d(A,P,J,G,te,ce){var q=P.children;if(q!==void 0)if(G)if(y(q)){for(G=0;G<q.length;G++)f(q[G]);Object.freeze&&Object.freeze(q)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(q);if(M.call(P,"key")){q=e(A);var ie=Object.keys(P).filter(function(ae){return ae!=="key"});G=0<ie.length?"{key: someKey, "+ie.join(": ..., ")+": ...}":"{key: someKey}",re[q+G]||(ie=0<ie.length?"{"+ie.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var qi;function Sd(){return qi||(qi=1,process.env.NODE_ENV!=="production"&&(function(){function e(A){if(A==null)return null;if(typeof A=="function")return A.$$typeof===I?null:A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case v:return"Fragment";case k:return"Profiler";case y:return"StrictMode";case E:return"Suspense";case j:return"SuspenseList";case R:return"Activity"}if(typeof A=="object")switch(typeof A.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),A.$$typeof){case m:return"Portal";case S:return A.displayName||"Context";case x:return(A._context.displayName||"Context")+".Consumer";case C:var W=A.render;return A=A.displayName,A||(A=W.displayName||W.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case N:return W=A.displayName||null,W!==null?W:e(A.type)||"Memo";case _:W=A._payload,A=A._init;try{return e(A(W))}catch{}}return null}function t(A){return""+A}function r(A){try{t(A);var W=!1}catch{W=!0}if(W){W=console;var q=W.error,G=typeof Symbol=="function"&&Symbol.toStringTag&&A[Symbol.toStringTag]||A.constructor.name||"Object";return q.call(W,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",G),t(A)}}function n(A){if(A===v)return"<>";if(typeof A=="object"&&A!==null&&A.$$typeof===_)return"<...>";try{var W=e(A);return W?"<"+W+">":"<...>"}catch{return"<...>"}}function o(){var A=L.A;return A===null?null:A.getOwner()}function i(){return Error("react-stack-top-frame")}function s(A){if(M.call(A,"key")){var W=Object.getOwnPropertyDescriptor(A,"key").get;if(W&&W.isReactWarning)return!1}return A.key!==void 0}function a(A,W){function q(){U||(U=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",W))}q.isReactWarning=!0,Object.defineProperty(A,"key",{get:q,configurable:!0})}function l(){var A=e(this.type);return B[A]||(B[A]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),A=this.props.ref,A!==void 0?A:null}function d(A,W,q,G,me,se){var P=q.ref;return A={$$typeof:w,type:A,key:W,props:q,_owner:G},(P!==void 0?P:null)!==null?Object.defineProperty(A,"ref",{enumerable:!1,get:l}):Object.defineProperty(A,"ref",{enumerable:!1,value:null}),A._store={},Object.defineProperty(A._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(A,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(A,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:me}),Object.defineProperty(A,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:se}),Object.freeze&&(Object.freeze(A.props),Object.freeze(A)),A}function u(A,W,q,G,me,se){var P=W.children;if(P!==void 0)if(G)if(Y(P)){for(G=0;G<P.length;G++)f(P[G]);Object.freeze&&Object.freeze(P)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(P);if(M.call(W,"key")){P=e(A);var J=Object.keys(W).filter(function(F){return F!=="key"});G=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",re[P+G]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
29
18
  let props = %s;
30
19
  <%s {...props} />
31
20
  React keys must be passed directly to JSX without using spread:
32
21
  let props = %s;
33
- <%s key={someKey} {...props} />`,G,q,ie,q),re[q+G]=!0)}if(q=null,J!==void 0&&(r(J),q=""+J),s(P)&&(r(P.key),q=""+P.key),"key"in P){J={};for(var ue in P)ue!=="key"&&(J[ue]=P[ue])}else J=P;return q&&a(J,typeof A=="function"?A.displayName||A.name||"Unknown":A),c(A,q,J,o(),te,ce)}function f(A){m(A)?A._store&&(A._store.validated=1):typeof A=="object"&&A!==null&&A.$$typeof===D&&(A._payload.status==="fulfilled"?m(A._payload.value)&&A._payload.value._store&&(A._payload.value._store.validated=1):A._store&&(A._store.validated=1))}function m(A){return typeof A=="object"&&A!==null&&A.$$typeof===w}var p=N,w=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),_=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),C=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,y=Array.isArray,L=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(A){return A()}};var Q,F={},$=p.react_stack_bottom_frame.bind(p,i)(),V=L(n(i)),re={};ur.Fragment=g,ur.jsx=function(A,P,J){var G=1e4>C.recentlyCreatedOwnerStacks++;return d(A,P,J,!1,G?Error("react-stack-top-frame"):$,G?L(n(A)):V)},ur.jsxs=function(A,P,J){var G=1e4>C.recentlyCreatedOwnerStacks++;return d(A,P,J,!0,G?Error("react-stack-top-frame"):$,G?L(n(A)):V)}})()),ur}var Ji;function Sd(){return Ji||(Ji=1,process.env.NODE_ENV==="production"?Yr.exports=kd():Yr.exports=_d()),Yr.exports}var h=Sd();const Qi=N.createContext(void 0),es=({config:e,children:t})=>h.jsx(Qi.Provider,{value:{registry:e.registry,schemas:e.schemas,tenantId:e.tenantId,assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:t});function fr(){const e=N.useContext(Qi);if(e===void 0)throw new Error("useConfig must be used within ConfigProvider");return e}const ts=N.createContext(void 0),qr=({mode:e,children:t})=>(N.useEffect(()=>{if(e!=="studio")return;const r=new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(i=>{i instanceof HTMLElement&&i.hasAttribute("data-radix-portal")&&i.setAttribute("data-jp-studio-portal","true")})})});return r.observe(document.body,{childList:!0}),()=>r.disconnect()},[e]),h.jsx(ts.Provider,{value:{mode:e},children:t})),rs=()=>{const e=N.useContext(ts);if(e===void 0)throw new Error("useStudio must be used within a StudioProvider");return e};/**
22
+ <%s key={someKey} {...props} />`,G,P,J,P),re[P+G]=!0)}if(P=null,q!==void 0&&(r(q),P=""+q),s(W)&&(r(W.key),P=""+W.key),"key"in W){q={};for(var te in W)te!=="key"&&(q[te]=W[te])}else q=W;return P&&a(q,typeof A=="function"?A.displayName||A.name||"Unknown":A),d(A,P,q,o(),me,se)}function f(A){h(A)?A._store&&(A._store.validated=1):typeof A=="object"&&A!==null&&A.$$typeof===_&&(A._payload.status==="fulfilled"?h(A._payload.value)&&A._payload.value._store&&(A._payload.value._store.validated=1):A._store&&(A._store.validated=1))}function h(A){return typeof A=="object"&&A!==null&&A.$$typeof===w}var p=b,w=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),S=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),L=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,Y=Array.isArray,H=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(A){return A()}};var U,B={},T=p.react_stack_bottom_frame.bind(p,i)(),X=H(n(i)),re={};fr.Fragment=v,fr.jsx=function(A,W,q){var G=1e4>L.recentlyCreatedOwnerStacks++;return u(A,W,q,!1,G?Error("react-stack-top-frame"):T,G?H(n(A)):X)},fr.jsxs=function(A,W,q){var G=1e4>L.recentlyCreatedOwnerStacks++;return u(A,W,q,!0,G?Error("react-stack-top-frame"):T,G?H(n(A)):X)}})()),fr}var Xi;function Cd(){return Xi||(Xi=1,process.env.NODE_ENV==="production"?qr.exports=kd():qr.exports=Sd()),qr.exports}var c=Cd();const Ji=b.createContext(void 0),Zi=({config:e,children:t})=>c.jsx(Ji.Provider,{value:{registry:e.registry,schemas:e.schemas,tenantId:e.tenantId,assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:t});function pr(){const e=b.useContext(Ji);if(e===void 0)throw new Error("useConfig must be used within ConfigProvider");return e}const Qi=b.createContext(void 0),Xr=({mode:e,children:t})=>(b.useEffect(()=>{if(e!=="studio")return;const r=new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(i=>{i instanceof HTMLElement&&i.hasAttribute("data-radix-portal")&&i.setAttribute("data-jp-studio-portal","true")})})});return r.observe(document.body,{childList:!0}),()=>r.disconnect()},[e]),c.jsx(Qi.Provider,{value:{mode:e},children:t})),es=()=>{const e=b.useContext(Qi);if(e===void 0)throw new Error("useStudio must be used within a StudioProvider");return e};/**
34
23
  * @license lucide-react v0.474.0 - ISC
35
24
  *
36
25
  * This source code is licensed under the ISC license.
37
26
  * See the LICENSE file in the root directory of this source tree.
38
- */const Cd=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ns=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
27
+ */const Ed=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ts=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
39
28
  * @license lucide-react v0.474.0 - ISC
40
29
  *
41
30
  * This source code is licensed under the ISC license.
42
31
  * See the LICENSE file in the root directory of this source tree.
43
- */var Ed={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
32
+ */var Nd={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
44
33
  * @license lucide-react v0.474.0 - ISC
45
34
  *
46
35
  * This source code is licensed under the ISC license.
47
36
  * See the LICENSE file in the root directory of this source tree.
48
- */const Nd=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...a},l)=>N.createElement("svg",{ref:l,...Ed,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ns("lucide",o),...a},[...s.map(([c,d])=>N.createElement(c,d)),...Array.isArray(i)?i:[i]]));/**
37
+ */const jd=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:s,...a},l)=>b.createElement("svg",{ref:l,...Nd,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ts("lucide",o),...a},[...s.map(([d,u])=>b.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
49
38
  * @license lucide-react v0.474.0 - ISC
50
39
  *
51
40
  * This source code is licensed under the ISC license.
52
41
  * See the LICENSE file in the root directory of this source tree.
53
- */const Ne=(e,t)=>{const r=N.forwardRef(({className:n,...o},i)=>N.createElement(Nd,{ref:i,iconNode:t,className:ns(`lucide-${Cd(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
42
+ */const he=(e,t)=>{const r=b.forwardRef(({className:n,...o},i)=>b.createElement(jd,{ref:i,iconNode:t,className:ts(`lucide-${Ed(e)}`,n),...o}));return r.displayName=`${e}`,r};/**
54
43
  * @license lucide-react v0.474.0 - ISC
55
44
  *
56
45
  * This source code is licensed under the ISC license.
57
46
  * See the LICENSE file in the root directory of this source tree.
58
- */const zd=Ne("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
47
+ */const Ad=he("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
59
48
  * @license lucide-react v0.474.0 - ISC
60
49
  *
61
50
  * This source code is licensed under the ISC license.
62
51
  * See the LICENSE file in the root directory of this source tree.
63
- */const jd=Ne("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
52
+ */const Td=he("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
64
53
  * @license lucide-react v0.474.0 - ISC
65
54
  *
66
55
  * This source code is licensed under the ISC license.
67
56
  * See the LICENSE file in the root directory of this source tree.
68
- */const Ad=Ne("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
57
+ */const zd=he("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
69
58
  * @license lucide-react v0.474.0 - ISC
70
59
  *
71
60
  * This source code is licensed under the ISC license.
72
61
  * See the LICENSE file in the root directory of this source tree.
73
- */const Td=Ne("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
62
+ */const Pd=he("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
74
63
  * @license lucide-react v0.474.0 - ISC
75
64
  *
76
65
  * This source code is licensed under the ISC license.
77
66
  * See the LICENSE file in the root directory of this source tree.
78
- */const so=Ne("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
67
+ */const io=he("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
79
68
  * @license lucide-react v0.474.0 - ISC
80
69
  *
81
70
  * This source code is licensed under the ISC license.
82
71
  * See the LICENSE file in the root directory of this source tree.
83
- */const Xr=Ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
72
+ */const Jr=he("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
84
73
  * @license lucide-react v0.474.0 - ISC
85
74
  *
86
75
  * This source code is licensed under the ISC license.
87
76
  * See the LICENSE file in the root directory of this source tree.
88
- */const Od=Ne("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
77
+ */const Od=he("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
89
78
  * @license lucide-react v0.474.0 - ISC
90
79
  *
91
80
  * This source code is licensed under the ISC license.
92
81
  * See the LICENSE file in the root directory of this source tree.
93
- */const ao=Ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
82
+ */const so=he("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
94
83
  * @license lucide-react v0.474.0 - ISC
95
84
  *
96
85
  * This source code is licensed under the ISC license.
97
86
  * See the LICENSE file in the root directory of this source tree.
98
- */const Id=Ne("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
87
+ */const Id=he("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
99
88
  * @license lucide-react v0.474.0 - ISC
100
89
  *
101
90
  * This source code is licensed under the ISC license.
102
91
  * See the LICENSE file in the root directory of this source tree.
103
- */const Pd=Ne("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
92
+ */const Dd=he("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
104
93
  * @license lucide-react v0.474.0 - ISC
105
94
  *
106
95
  * This source code is licensed under the ISC license.
107
96
  * See the LICENSE file in the root directory of this source tree.
108
- */const Dd=Ne("FileJson",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]);/**
97
+ */const _d=he("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
109
98
  * @license lucide-react v0.474.0 - ISC
110
99
  *
111
100
  * This source code is licensed under the ISC license.
112
101
  * See the LICENSE file in the root directory of this source tree.
113
- */const Rd=Ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
102
+ */const rs=he("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
114
103
  * @license lucide-react v0.474.0 - ISC
115
104
  *
116
105
  * This source code is licensed under the ISC license.
117
106
  * See the LICENSE file in the root directory of this source tree.
118
- */const Md=Ne("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
107
+ */const Zr=he("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
119
108
  * @license lucide-react v0.474.0 - ISC
120
109
  *
121
110
  * This source code is licensed under the ISC license.
122
111
  * See the LICENSE file in the root directory of this source tree.
123
- */const os=Ne("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
112
+ */const ao=he("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
124
113
  * @license lucide-react v0.474.0 - ISC
125
114
  *
126
115
  * This source code is licensed under the ISC license.
127
116
  * See the LICENSE file in the root directory of this source tree.
128
- */const Jr=Ne("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
117
+ */const ns=he("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
129
118
  * @license lucide-react v0.474.0 - ISC
130
119
  *
131
120
  * This source code is licensed under the ISC license.
132
121
  * See the LICENSE file in the root directory of this source tree.
133
- */const lo=Ne("Layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
122
+ */const Md=he("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
134
123
  * @license lucide-react v0.474.0 - ISC
135
124
  *
136
125
  * This source code is licensed under the ISC license.
137
126
  * See the LICENSE file in the root directory of this source tree.
138
- */const is=Ne("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
127
+ */const Rd=he("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
139
128
  * @license lucide-react v0.474.0 - ISC
140
129
  *
141
130
  * This source code is licensed under the ISC license.
142
131
  * See the LICENSE file in the root directory of this source tree.
143
- */const Ld=Ne("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
132
+ */const lo=he("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
144
133
  * @license lucide-react v0.474.0 - ISC
145
134
  *
146
135
  * This source code is licensed under the ISC license.
147
136
  * See the LICENSE file in the root directory of this source tree.
148
- */const Fd=Ne("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
137
+ */const os=he("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
149
138
  * @license lucide-react v0.474.0 - ISC
150
139
  *
151
140
  * This source code is licensed under the ISC license.
152
141
  * See the LICENSE file in the root directory of this source tree.
153
- */const co=Ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
142
+ */const Ld=he("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
154
143
  * @license lucide-react v0.474.0 - ISC
155
144
  *
156
145
  * This source code is licensed under the ISC license.
157
146
  * See the LICENSE file in the root directory of this source tree.
158
- */const ss=Ne("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
147
+ */const $d=he("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
159
148
  * @license lucide-react v0.474.0 - ISC
160
149
  *
161
150
  * This source code is licensed under the ISC license.
162
151
  * See the LICENSE file in the root directory of this source tree.
163
- */const Bd=Ne("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
152
+ */const Fd=he("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
164
153
  * @license lucide-react v0.474.0 - ISC
165
154
  *
166
155
  * This source code is licensed under the ISC license.
167
156
  * See the LICENSE file in the root directory of this source tree.
168
- */const Ud=Ne("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
157
+ */const Wd=he("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
169
158
  * @license lucide-react v0.474.0 - ISC
170
159
  *
171
160
  * This source code is licensed under the ISC license.
172
161
  * See the LICENSE file in the root directory of this source tree.
173
- */const $d=Ne("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
162
+ */const Qr=he("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
174
163
  * @license lucide-react v0.474.0 - ISC
175
164
  *
176
165
  * This source code is licensed under the ISC license.
177
166
  * See the LICENSE file in the root directory of this source tree.
178
- */const Wd=Ne("SquarePlus",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
167
+ */const Ud=he("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
179
168
  * @license lucide-react v0.474.0 - ISC
180
169
  *
181
170
  * This source code is licensed under the ISC license.
182
171
  * See the LICENSE file in the root directory of this source tree.
183
- */const Hd=Ne("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
172
+ */const is=he("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
184
173
  * @license lucide-react v0.474.0 - ISC
185
174
  *
186
175
  * This source code is licensed under the ISC license.
187
176
  * See the LICENSE file in the root directory of this source tree.
188
- */const Qr=Ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
177
+ */const Ut=he("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
189
178
  * @license lucide-react v0.474.0 - ISC
190
179
  *
191
180
  * This source code is licensed under the ISC license.
192
181
  * See the LICENSE file in the root directory of this source tree.
193
- */const Vd=Ne("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
194
- * @license lucide-react v0.474.0 - ISC
195
- *
196
- * This source code is licensed under the ISC license.
197
- * See the LICENSE file in the root directory of this source tree.
198
- */const as=Ne("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
199
- * @license lucide-react v0.474.0 - ISC
200
- *
201
- * This source code is licensed under the ISC license.
202
- * See the LICENSE file in the root directory of this source tree.
203
- */const Ft=Ne("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
204
- * @license lucide-react v0.474.0 - ISC
205
- *
206
- * This source code is licensed under the ISC license.
207
- * See the LICENSE file in the root directory of this source tree.
208
- */const Zd=Ne("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);class Gd extends N.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){console.error(`[JsonPages] Component Crash [${this.props.type}]:`,t,r)}render(){return this.state.hasError?h.jsxs("div",{className:"p-8 m-4 bg-amber-500/5 border-2 border-dashed border-amber-500/20 rounded-xl flex flex-col items-center text-center gap-3",children:[h.jsx(Vd,{className:"text-amber-500",size:32}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("h4",{className:"text-sm font-bold text-amber-200 uppercase tracking-tight",children:"Component Error"}),h.jsxs("p",{className:"text-xs text-amber-500/70 font-mono",children:["Type: ",this.props.type]})]}),h.jsx("p",{className:"text-xs text-zinc-400 max-w-[280px] leading-relaxed",children:"This section failed to render. Check the console for details or verify the JSON data structure."})]}):this.props.children}}const Kd=({type:e,scope:t,isSelected:r,sectionId:n,sectionIndex:o=0,totalSections:i=0,onReorder:s})=>{const a=typeof o=="number"&&o>0&&s,l=typeof o=="number"&&o<i-1&&s;return h.jsx("div",{"data-jp-section-overlay":!0,"aria-hidden":!0,className:ye("absolute inset-0 pointer-events-none transition-all duration-200 z-[50]","border-2 border-transparent group-hover:border-blue-400/50 group-hover:border-dashed",r&&"border-2 border-blue-600 border-solid bg-blue-500/5"),children:h.jsxs("div",{className:ye("absolute top-0 right-0 flex flex-nowrap items-center gap-1 pl-1 pr-2 py-1 text-[9px] font-black uppercase tracking-widest transition-opacity pointer-events-auto","bg-blue-600 text-white",r||"group-hover:opacity-100 opacity-0"),children:[s&&n!=null&&h.jsxs("span",{className:"shrink-0 flex items-center gap-0.5",children:[h.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),a&&s(n,o-1)},disabled:!a,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section up","aria-label":"Move section up",children:h.jsx(ao,{size:12,strokeWidth:2.5})}),h.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),l&&s(n,o+2)},disabled:!l,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section down","aria-label":"Move section down",children:h.jsx(Xr,{size:12,strokeWidth:2.5})})]}),h.jsx("span",{className:"shrink-0",children:e}),h.jsx("span",{className:"opacity-50 shrink-0",children:"|"}),h.jsx("span",{className:"shrink-0",children:t})]})})},pr=({section:e,menu:t,selectedId:r,reorderable:n,sectionIndex:o,totalSections:i,onReorder:s})=>{var v,k;const{mode:a}=rs(),{registry:l,overlayDisabledSectionTypes:c}=fr(),d=a==="studio",f=d&&r===e.id,m=l[e.type],p=e.type==="header"||e.type==="footer"?"global":"local",w=Array.isArray(c)?c.includes(e.type):!1,u=e.type==="header"&&((v=e.settings)==null?void 0:v.sticky);if(!m)return h.jsxs("div",{className:"p-6 m-4 bg-red-500/10 text-red-400 border border-red-500/20 rounded-lg text-sm font-mono",children:[h.jsx("strong",{children:"Missing Component:"})," ",e.type]});const g=()=>{const _=m;return e.type==="header"&&t?h.jsx(_,{data:e.data,settings:e.settings,menu:t}):h.jsx(_,{data:e.data,settings:e.settings})},b=(k=e.data)==null?void 0:k.anchorId;return h.jsxs("div",{id:b||void 0,"data-section-id":d?e.id:void 0,"data-section-type":d?e.type:void 0,"data-section-scope":d?p:void 0,...d&&f?{"data-jp-selected":!0}:{},className:ye("relative w-full",d&&!w&&"group cursor-pointer",d&&u?"sticky top-0 z-[60]":e.type==="header"?"relative":"relative z-0",f&&"z-[70]"),children:[h.jsx("div",{className:e.type==="header"?"relative":"relative z-0",children:h.jsx(Gd,{type:e.type,children:g()})}),d&&!w&&h.jsx(Kd,{type:e.type,scope:p,isSelected:!!f,sectionId:n&&p==="local"?e.id:void 0,sectionIndex:n&&p==="local"?o:void 0,totalSections:n&&p==="local"?i:void 0,onReorder:n&&p==="local"?s:void 0})]})},Yd=e=>{N.useEffect(()=>{document.title=e.title;let t=document.querySelector('meta[name="description"]');t||(t=document.createElement("meta"),t.setAttribute("name","description"),document.head.appendChild(t)),t.setAttribute("content",e.description)},[e.title,e.description])};function hr(e){return typeof e=="object"&&e!==null}function en(e){if(!hr(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function qd(e){return hr(e)&&typeof e.$ref=="string"&&e.$ref.trim().length>0}function Xd(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ls(e,t){if(!t||t==="#")return e;const r=t.startsWith("#")?t.slice(1):t;if(!r||r==="/")return e;let n=e;for(const o of r.replace(/^\//,"").split("/")){const i=Xd(o);if(Array.isArray(n)){const s=Number(i);if(!Number.isInteger(s)||s<0||s>=n.length)return;n=n[s];continue}if(!hr(n)||!(i in n))return;n=n[i]}return n}function Bt(e){const n=e.trim().replace(/\\/g,"/").replace(/^\/+/,"").split("/"),o=[];for(const i of n)if(!(!i||i===".")){if(i===".."){o.length>0&&o.pop();continue}o.push(i)}return o.join("/")}function Jd(e){const t=Bt(e),r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function Qd(e,t){const r=new Set,n=Bt(e);n&&r.add(n);const o=Jd(t),i=Bt(o?`${o}/${e}`:e);return i&&r.add(i),Array.from(r)}function mr(e){return Array.isArray(e)?e.map(t=>mr(t)):en(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,mr(r)])):e}function gr(e,t,r){for(const n of t){const o=Bt(n);o&&e.set(o,r)}}function eu({pages:e,siteConfig:t,themeConfig:r,menuConfig:n,refDocuments:o}){const i=new Map;gr(i,["site.json","config/site.json","src/data/config/site.json"],t),gr(i,["theme.json","config/theme.json","src/data/config/theme.json"],r),gr(i,["menu.json","config/menu.json","src/data/config/menu.json"],n);for(const[s,a]of Object.entries(e)){const l=s.replace(/^\/+|\/+$/g,"")||"home";gr(i,[`pages/${l}.json`,`src/data/pages/${l}.json`],a)}for(const[s,a]of Object.entries(o??{}))gr(i,[s],a);return i}function tu(e,t,r){const[n,o=""]=e.split("#"),i=o?`/${o.replace(/^\//,"")}`:"";if(!n){const s=Bt(t),a=r.documents.get(s);if(a===void 0)return null;const l=ls(a,i);return l===void 0?null:{value:l,documentPath:s}}for(const s of Qd(n,t)){const a=r.documents.get(s);if(a===void 0)continue;const l=ls(a,i);if(l!==void 0)return{value:l,documentPath:s}}return null}function At(e,t,r){if(Array.isArray(e))return e.map(n=>At(n,t,r));if(!en(e))return e;if(qd(e)){const n=`${Bt(t)}::${e.$ref}`;if(r.stack.includes(n))return console.warn("[JsonPages] Circular $ref skipped",e.$ref),mr(e);if(r.cache.has(n)){const l=mr(r.cache.get(n)),c=Object.entries(e).filter(([f])=>f!=="$ref");if(c.length===0)return l;const d=Object.fromEntries(c.map(([f,m])=>[f,At(m,t,r)]));return en(l)?{...l,...d}:l}const o=tu(e.$ref,t,r);if(!o)return console.warn("[JsonPages] Unresolved $ref",e.$ref),Object.fromEntries(Object.entries(e).map(([l,c])=>[l,At(c,t,r)]));r.stack.push(n);const i=At(o.value,o.documentPath,r);r.stack.pop(),r.cache.set(n,mr(i));const s=Object.entries(e).filter(([l])=>l!=="$ref");if(s.length===0)return i;const a=Object.fromEntries(s.map(([l,c])=>[l,At(c,t,r)]));return en(i)?{...i,...a}:i}return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,At(o,t,r)]))}function tn(e,t,r){return At(e,t,{documents:r,cache:new Map,stack:[]})}function uo(e){return hr(e)?typeof e.label=="string"&&typeof e.href=="string":!1}function ru(e){if(!hr(e))return null;const t=e.links;if(Array.isArray(t)&&t.every(uo))return t;const r=e.menu;if(Array.isArray(r)&&r.every(uo))return r;const n=e.menuConfig;return Array.isArray(n)&&n.every(uo)?n:null}function rn(e,t){const r=ru(e);return r||(Array.isArray(t)?t:[])}function nn(e,t){if(e.type==="header")return rn(e.data,t)}function Ut(e){const t=eu(e);return{pages:Object.fromEntries(Object.entries(e.pages).map(([r,n])=>[r,tn(n,`pages/${r.replace(/^\/+|\/+$/g,"")||"home"}.json`,t)])),siteConfig:tn(e.siteConfig,"config/site.json",t),themeConfig:tn(e.themeConfig,"config/theme.json",t),menuConfig:tn(e.menuConfig,"config/menu.json",t)}}const nu="application/json",fo=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:o,scrollToSectionId:i,onActiveSectionChange:s})=>{var b,v;Yd(e.meta);const[a,l]=N.useState(null),c=N.useRef({}),d=N.useRef(s);d.current=s;const f=Ei(e,t),m=k=>{var _;(_=d.current)==null||_.call(d,k)};N.useEffect(()=>{if(!i)return;const k=c.current[i];k&&k.scrollIntoView({behavior:"smooth",block:"center"})},[i]),N.useEffect(()=>{if(!d.current)return;const _=[...f&&t.header?[t.header.id]:[],...e.sections.map(I=>I.id),...t.footer?[t.footer.id]:[]],S=new IntersectionObserver(I=>{I.forEach(D=>{var U;if(D.isIntersecting&&D.intersectionRatio>.5){const H=D.target.getAttribute("data-section-id");H&&((U=d.current)==null||U.call(d,H))}})},{threshold:[0,.5,1],rootMargin:"-20% 0px -20% 0px"});let O=!1;const z=requestAnimationFrame(()=>{O||_.forEach(I=>{const D=c.current[I];D&&S.observe(D)})});return()=>{O=!0,cancelAnimationFrame(z),S.disconnect()}},[e.sections,e["global-header"],f,(b=t.header)==null?void 0:b.id,(v=t.footer)==null?void 0:v.id]);const p=(k,_)=>{k.preventDefault(),k.dataTransfer.dropEffect="move",l(_)},w=()=>{l(null)},u=(k,_)=>{if(k.preventDefault(),l(null),!!o)try{const S=k.dataTransfer.getData(nu),{sectionId:O}=JSON.parse(S);typeof O=="string"&&o(O,_)}catch{}},g=()=>{const k=typeof o=="function",_=e.sections.map((S,O)=>{const z=a===O;return k?h.jsxs("div",{ref:I=>{c.current[S.id]=I},"data-section-id":S.id,style:{position:"relative"},onMouseEnter:()=>m(S.id),children:[h.jsx("div",{"data-jp-drop-zone":!0,style:{position:"absolute",left:0,right:0,top:-1,height:12,zIndex:55,pointerEvents:"auto",backgroundColor:z?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:z?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:I=>p(I,O),onDragLeave:w,onDrop:I=>u(I,O)}),h.jsx(pr,{section:S,menu:nn(S,r.main),selectedId:n,reorderable:!0,sectionIndex:O,totalSections:e.sections.length,onReorder:o})]},S.id):h.jsx("div",{ref:I=>{c.current[S.id]=I},"data-section-id":S.id,onMouseEnter:()=>m(S.id),children:h.jsx(pr,{section:S,menu:nn(S,r.main),selectedId:n})},S.id)});if(k&&_.length>0){const S=e.sections.length,O=a===S;_.push(h.jsx("div",{"data-jp-drop-zone":!0,style:{position:"relative",left:0,right:0,height:24,minHeight:24,zIndex:55,pointerEvents:"auto",backgroundColor:O?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:O?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:z=>p(z,S),onDragLeave:w,onDrop:z=>u(z,S)},"jp-drop-after-last"))}return _};return h.jsxs("div",{className:"min-h-screen flex flex-col bg-[var(--color-background)]",children:[f&&t.header!=null&&h.jsx("div",{ref:k=>{c.current[t.header.id]=k},"data-section-id":t.header.id,onMouseEnter:()=>m(t.header.id),children:h.jsx(pr,{section:t.header,menu:nn(t.header,r.main),selectedId:n})}),h.jsx("main",{className:"flex-1",children:g()}),t.footer!=null&&h.jsx("div",{ref:k=>{c.current[t.footer.id]=k},"data-section-id":t.footer.id,onMouseEnter:()=>m(t.footer.id),children:h.jsx(pr,{section:t.footer,selectedId:n})})]})},on=({mode:e,tenantCss:t,adminCss:r,children:n})=>(N.useLayoutEffect(()=>{const o=`jp-theme-${e}`,i=e==="tenant"?t:r;if(!document.getElementById(o)&&i){const s=document.createElement("style");s.id=o,s.innerHTML=i,document.head.appendChild(s)}return()=>{const s=document.getElementById(o);s&&s.remove()}},[e,t,r]),h.jsx(h.Fragment,{children:n}));function ou(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return N.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const sn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $t(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function po(e){return"nodeType"in e}function $e(e){var t,r;return e?$t(e)?e:po(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function ho(e){const{Document:t}=$e(e);return e instanceof t}function br(e){return $t(e)?!1:e instanceof $e(e).HTMLElement}function cs(e){return e instanceof $e(e).SVGElement}function Wt(e){return e?$t(e)?e.document:po(e)?ho(e)?e:br(e)||cs(e)?e.ownerDocument:document:document:document}const Je=sn?N.useLayoutEffect:N.useEffect;function an(e){const t=N.useRef(e);return Je(()=>{t.current=e}),N.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function iu(){const e=N.useRef(null),t=N.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=N.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function vr(e,t){t===void 0&&(t=[e]);const r=N.useRef(e);return Je(()=>{r.current!==e&&(r.current=e)},t),r}function xr(e,t){const r=N.useRef();return N.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function ln(e){const t=an(e),r=N.useRef(null),n=N.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function cn(e){const t=N.useRef();return N.useEffect(()=>{t.current=e},[e]),t.current}let mo={};function wr(e,t){return N.useMemo(()=>{if(t)return t;const r=mo[e]==null?0:mo[e]+1;return mo[e]=r,e+"-"+r},[e,t])}function ds(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((i,s)=>{const a=Object.entries(s);for(const[l,c]of a){const d=i[l];d!=null&&(i[l]=d+e*c)}return i},{...t})}}const Ht=ds(1),yr=ds(-1);function su(e){return"clientX"in e&&"clientY"in e}function dn(e){if(!e)return!1;const{KeyboardEvent:t}=$e(e.target);return t&&e instanceof t}function au(e){if(!e)return!1;const{TouchEvent:t}=$e(e.target);return t&&e instanceof t}function un(e){if(au(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return su(e)?{x:e.clientX,y:e.clientY}:null}const vt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[vt.Translate.toString(e),vt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),us="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function lu(e){return e.matches(us)?e:e.querySelector(us)}const cu={display:"none"};function du(e){let{id:t,value:r}=e;return N.createElement("div",{id:t,style:cu},r)}function uu(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return N.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function fu(){const[e,t]=N.useState("");return{announce:N.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const fs=N.createContext(null);function pu(e){const t=N.useContext(fs);N.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function hu(){const[e]=N.useState(()=>new Set),t=N.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[N.useCallback(n=>{let{type:o,event:i}=n;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const mu={draggable:`
182
+ */const Bd=he("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);class Hd extends b.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){console.error(`[JsonPages] Component Crash [${this.props.type}]:`,t,r)}render(){return this.state.hasError?c.jsxs("div",{className:"p-8 m-4 bg-amber-500/5 border-2 border-dashed border-amber-500/20 rounded-xl flex flex-col items-center text-center gap-3",children:[c.jsx(Ud,{className:"text-amber-500",size:32}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("h4",{className:"text-sm font-bold text-amber-200 uppercase tracking-tight",children:"Component Error"}),c.jsxs("p",{className:"text-xs text-amber-500/70 font-mono",children:["Type: ",this.props.type]})]}),c.jsx("p",{className:"text-xs text-zinc-400 max-w-[280px] leading-relaxed",children:"This section failed to render. Check the console for details or verify the JSON data structure."})]}):this.props.children}}const Vd=({type:e,scope:t,isSelected:r,sectionId:n,sectionIndex:o=0,totalSections:i=0,onReorder:s})=>{const a=typeof o=="number"&&o>0&&s,l=typeof o=="number"&&o<i-1&&s;return c.jsx("div",{"data-jp-section-overlay":!0,"aria-hidden":!0,className:oe("absolute inset-0 pointer-events-none transition-all duration-200 z-[50]","border-2 border-transparent group-hover:border-blue-400/50 group-hover:border-dashed",r&&"border-2 border-blue-600 border-solid bg-blue-500/5"),children:c.jsxs("div",{className:oe("absolute top-0 right-0 flex flex-nowrap items-center gap-1 pl-1 pr-2 py-1 text-[9px] font-black uppercase tracking-widest transition-opacity pointer-events-auto","bg-blue-600 text-white",r||"group-hover:opacity-100 opacity-0"),children:[s&&n!=null&&c.jsxs("span",{className:"shrink-0 flex items-center gap-0.5",children:[c.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),a&&s(n,o-1)},disabled:!a,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section up","aria-label":"Move section up",children:c.jsx(so,{size:12,strokeWidth:2.5})}),c.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),l&&s(n,o+2)},disabled:!l,className:"inline-flex items-center justify-center min-w-[18px] min-h-[18px] rounded bg-white/20 hover:bg-white/30 disabled:opacity-30 disabled:pointer-events-none",title:"Move section down","aria-label":"Move section down",children:c.jsx(Jr,{size:12,strokeWidth:2.5})})]}),c.jsx("span",{className:"shrink-0",children:e}),c.jsx("span",{className:"opacity-50 shrink-0",children:"|"}),c.jsx("span",{className:"shrink-0",children:t})]})})},hr=({section:e,menu:t,selectedId:r,reorderable:n,sectionIndex:o,totalSections:i,onReorder:s})=>{var k,x;const{mode:a}=es(),{registry:l,overlayDisabledSectionTypes:d}=pr(),u=a==="studio",f=u&&r===e.id,h=l[e.type],p=e.type==="header"||e.type==="footer"?"global":"local",w=Array.isArray(d)?d.includes(e.type):!1,m=e.type==="header"&&((k=e.settings)==null?void 0:k.sticky);if(!h)return c.jsxs("div",{className:"p-6 m-4 bg-red-500/10 text-red-400 border border-red-500/20 rounded-lg text-sm font-mono",children:[c.jsx("strong",{children:"Missing Component:"})," ",e.type]});const v=()=>{const S=h;return e.type==="header"&&t?c.jsx(S,{data:e.data,settings:e.settings,menu:t}):c.jsx(S,{data:e.data,settings:e.settings})},y=(x=e.data)==null?void 0:x.anchorId;return c.jsxs("div",{id:y||void 0,"data-section-id":u?e.id:void 0,"data-section-type":u?e.type:void 0,"data-section-scope":u?p:void 0,...u&&f?{"data-jp-selected":!0}:{},className:oe("relative w-full",u&&!w&&"group cursor-pointer",u&&m?"sticky top-0 z-[60]":e.type==="header"?"relative":"relative z-0",f&&"z-[70]"),children:[c.jsx("div",{className:e.type==="header"?"relative":"relative z-0",children:c.jsx(Hd,{type:e.type,children:v()})}),u&&!w&&c.jsx(Vd,{type:e.type,scope:p,isSelected:!!f,sectionId:n&&p==="local"?e.id:void 0,sectionIndex:n&&p==="local"?o:void 0,totalSections:n&&p==="local"?i:void 0,onReorder:n&&p==="local"?s:void 0})]})},Kd=e=>{b.useEffect(()=>{document.title=e.title;let t=document.querySelector('meta[name="description"]');t||(t=document.createElement("meta"),t.setAttribute("name","description"),document.head.appendChild(t)),t.setAttribute("content",e.description)},[e.title,e.description])};function mr(e){return typeof e=="object"&&e!==null}function en(e){if(!mr(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Gd(e){return mr(e)&&typeof e.$ref=="string"&&e.$ref.trim().length>0}function Yd(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function ss(e,t){if(!t||t==="#")return e;const r=t.startsWith("#")?t.slice(1):t;if(!r||r==="/")return e;let n=e;for(const o of r.replace(/^\//,"").split("/")){const i=Yd(o);if(Array.isArray(n)){const s=Number(i);if(!Number.isInteger(s)||s<0||s>=n.length)return;n=n[s];continue}if(!mr(n)||!(i in n))return;n=n[i]}return n}function Bt(e){const n=e.trim().replace(/\\/g,"/").replace(/^\/+/,"").split("/"),o=[];for(const i of n)if(!(!i||i===".")){if(i===".."){o.length>0&&o.pop();continue}o.push(i)}return o.join("/")}function qd(e){const t=Bt(e),r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function Xd(e,t){const r=new Set,n=Bt(e);n&&r.add(n);const o=qd(t),i=Bt(o?`${o}/${e}`:e);return i&&r.add(i),Array.from(r)}function gr(e){return Array.isArray(e)?e.map(t=>gr(t)):en(e)?Object.fromEntries(Object.entries(e).map(([t,r])=>[t,gr(r)])):e}function br(e,t,r){for(const n of t){const o=Bt(n);o&&e.set(o,r)}}function Jd({pages:e,siteConfig:t,themeConfig:r,menuConfig:n,refDocuments:o}){const i=new Map;br(i,["site.json","config/site.json","src/data/config/site.json"],t),br(i,["theme.json","config/theme.json","src/data/config/theme.json"],r),br(i,["menu.json","config/menu.json","src/data/config/menu.json"],n);for(const[s,a]of Object.entries(e)){const l=s.replace(/^\/+|\/+$/g,"")||"home";br(i,[`pages/${l}.json`,`src/data/pages/${l}.json`],a)}for(const[s,a]of Object.entries(o??{}))br(i,[s],a);return i}function Zd(e,t,r){const[n,o=""]=e.split("#"),i=o?`/${o.replace(/^\//,"")}`:"";if(!n){const s=Bt(t),a=r.documents.get(s);if(a===void 0)return null;const l=ss(a,i);return l===void 0?null:{value:l,documentPath:s}}for(const s of Xd(n,t)){const a=r.documents.get(s);if(a===void 0)continue;const l=ss(a,i);if(l!==void 0)return{value:l,documentPath:s}}return null}function Ot(e,t,r){if(Array.isArray(e))return e.map(n=>Ot(n,t,r));if(!en(e))return e;if(Gd(e)){const n=`${Bt(t)}::${e.$ref}`;if(r.stack.includes(n))return console.warn("[JsonPages] Circular $ref skipped",e.$ref),gr(e);if(r.cache.has(n)){const l=gr(r.cache.get(n)),d=Object.entries(e).filter(([f])=>f!=="$ref");if(d.length===0)return l;const u=Object.fromEntries(d.map(([f,h])=>[f,Ot(h,t,r)]));return en(l)?{...l,...u}:l}const o=Zd(e.$ref,t,r);if(!o)return console.warn("[JsonPages] Unresolved $ref",e.$ref),Object.fromEntries(Object.entries(e).map(([l,d])=>[l,Ot(d,t,r)]));r.stack.push(n);const i=Ot(o.value,o.documentPath,r);r.stack.pop(),r.cache.set(n,gr(i));const s=Object.entries(e).filter(([l])=>l!=="$ref");if(s.length===0)return i;const a=Object.fromEntries(s.map(([l,d])=>[l,Ot(d,t,r)]));return en(i)?{...i,...a}:i}return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,Ot(o,t,r)]))}function tn(e,t,r){return Ot(e,t,{documents:r,cache:new Map,stack:[]})}function co(e){return mr(e)?typeof e.label=="string"&&typeof e.href=="string":!1}function Qd(e){if(!mr(e))return null;const t=e.links;if(Array.isArray(t)&&t.every(co))return t;const r=e.menu;if(Array.isArray(r)&&r.every(co))return r;const n=e.menuConfig;return Array.isArray(n)&&n.every(co)?n:null}function rn(e,t){const r=Qd(e);return r||(Array.isArray(t)?t:[])}function nn(e,t){if(e.type==="header")return rn(e.data,t)}function It(e){const t=Jd(e);return{pages:Object.fromEntries(Object.entries(e.pages).map(([r,n])=>[r,tn(n,`pages/${r.replace(/^\/+|\/+$/g,"")||"home"}.json`,t)])),siteConfig:tn(e.siteConfig,"config/site.json",t),themeConfig:tn(e.themeConfig,"config/theme.json",t),menuConfig:tn(e.menuConfig,"config/menu.json",t)}}const eu="application/json",uo=({pageConfig:e,siteConfig:t,menuConfig:r,selectedId:n,onReorder:o,scrollToSectionId:i,onActiveSectionChange:s})=>{var y,k;Kd(e.meta);const[a,l]=b.useState(null),d=b.useRef({}),u=b.useRef(s);u.current=s;const f=Ti(e,t),h=x=>{var S;(S=u.current)==null||S.call(u,x)};b.useEffect(()=>{if(!i)return;const x=d.current[i];x&&x.scrollIntoView({behavior:"smooth",block:"center"})},[i]),b.useEffect(()=>{if(!u.current)return;const S=[...f&&t.header?[t.header.id]:[],...e.sections.map(N=>N.id),...t.footer?[t.footer.id]:[]],C=new IntersectionObserver(N=>{N.forEach(_=>{var R;if(_.isIntersecting&&_.intersectionRatio>.5){const I=_.target.getAttribute("data-section-id");I&&((R=u.current)==null||R.call(u,I))}})},{threshold:[0,.5,1],rootMargin:"-20% 0px -20% 0px"});let E=!1;const j=requestAnimationFrame(()=>{E||S.forEach(N=>{const _=d.current[N];_&&C.observe(_)})});return()=>{E=!0,cancelAnimationFrame(j),C.disconnect()}},[e.sections,e["global-header"],f,(y=t.header)==null?void 0:y.id,(k=t.footer)==null?void 0:k.id]);const p=(x,S)=>{x.preventDefault(),x.dataTransfer.dropEffect="move",l(S)},w=()=>{l(null)},m=(x,S)=>{if(x.preventDefault(),l(null),!!o)try{const C=x.dataTransfer.getData(eu),{sectionId:E}=JSON.parse(C);typeof E=="string"&&o(E,S)}catch{}},v=()=>{const x=typeof o=="function",S=e.sections.map((C,E)=>{const j=a===E;return x?c.jsxs("div",{ref:N=>{d.current[C.id]=N},"data-section-id":C.id,style:{position:"relative"},onMouseEnter:()=>h(C.id),children:[c.jsx("div",{"data-jp-drop-zone":!0,style:{position:"absolute",left:0,right:0,top:-1,height:12,zIndex:55,pointerEvents:"auto",backgroundColor:j?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:j?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:N=>p(N,E),onDragLeave:w,onDrop:N=>m(N,E)}),c.jsx(hr,{section:C,menu:nn(C,r.main),selectedId:n,reorderable:!0,sectionIndex:E,totalSections:e.sections.length,onReorder:o})]},C.id):c.jsx("div",{ref:N=>{d.current[C.id]=N},"data-section-id":C.id,onMouseEnter:()=>h(C.id),children:c.jsx(hr,{section:C,menu:nn(C,r.main),selectedId:n})},C.id)});if(x&&S.length>0){const C=e.sections.length,E=a===C;S.push(c.jsx("div",{"data-jp-drop-zone":!0,style:{position:"relative",left:0,right:0,height:24,minHeight:24,zIndex:55,pointerEvents:"auto",backgroundColor:E?"rgba(59, 130, 246, 0.4)":"transparent",borderTop:E?"2px solid rgb(96, 165, 250)":"2px solid transparent"},onDragOver:j=>p(j,C),onDragLeave:w,onDrop:j=>m(j,C)},"jp-drop-after-last"))}return S};return c.jsxs("div",{className:"min-h-screen flex flex-col bg-[var(--color-background)]",children:[f&&t.header!=null&&c.jsx("div",{ref:x=>{d.current[t.header.id]=x},"data-section-id":t.header.id,onMouseEnter:()=>h(t.header.id),children:c.jsx(hr,{section:t.header,menu:nn(t.header,r.main),selectedId:n})}),c.jsx("main",{className:"flex-1",children:v()}),t.footer!=null&&c.jsx("div",{ref:x=>{d.current[t.footer.id]=x},"data-section-id":t.footer.id,onMouseEnter:()=>h(t.footer.id),children:c.jsx(hr,{section:t.footer,selectedId:n})})]})},on=({mode:e,tenantCss:t,adminCss:r,children:n})=>(b.useLayoutEffect(()=>{const o=`jp-theme-${e}`,i=e==="tenant"?t:r;if(!document.getElementById(o)&&i){const s=document.createElement("style");s.id=o,s.innerHTML=i,document.head.appendChild(s)}return()=>{const s=document.getElementById(o);s&&s.remove()}},[e,t,r]),c.jsx(c.Fragment,{children:n}));function tu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return b.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const sn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ht(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function fo(e){return"nodeType"in e}function Fe(e){var t,r;return e?Ht(e)?e:fo(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function po(e){const{Document:t}=Fe(e);return e instanceof t}function vr(e){return Ht(e)?!1:e instanceof Fe(e).HTMLElement}function as(e){return e instanceof Fe(e).SVGElement}function Vt(e){return e?Ht(e)?e.document:fo(e)?po(e)?e:vr(e)||as(e)?e.ownerDocument:document:document:document}const Qe=sn?b.useLayoutEffect:b.useEffect;function an(e){const t=b.useRef(e);return Qe(()=>{t.current=e}),b.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function ru(){const e=b.useRef(null),t=b.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function xr(e,t){t===void 0&&(t=[e]);const r=b.useRef(e);return Qe(()=>{r.current!==e&&(r.current=e)},t),r}function wr(e,t){const r=b.useRef();return b.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function ln(e){const t=an(e),r=b.useRef(null),n=b.useCallback(o=>{o!==r.current&&(t==null||t(o,r.current)),r.current=o},[]);return[r,n]}function cn(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let ho={};function yr(e,t){return b.useMemo(()=>{if(t)return t;const r=ho[e]==null?0:ho[e]+1;return ho[e]=r,e+"-"+r},[e,t])}function ls(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((i,s)=>{const a=Object.entries(s);for(const[l,d]of a){const u=i[l];u!=null&&(i[l]=u+e*d)}return i},{...t})}}const Kt=ls(1),kr=ls(-1);function nu(e){return"clientX"in e&&"clientY"in e}function dn(e){if(!e)return!1;const{KeyboardEvent:t}=Fe(e.target);return t&&e instanceof t}function ou(e){if(!e)return!1;const{TouchEvent:t}=Fe(e.target);return t&&e instanceof t}function un(e){if(ou(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return nu(e)?{x:e.clientX,y:e.clientY}:null}const xt=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[xt.Translate.toString(e),xt.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),cs="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function iu(e){return e.matches(cs)?e:e.querySelector(cs)}const su={display:"none"};function au(e){let{id:t,value:r}=e;return b.createElement("div",{id:t,style:su},r)}function lu(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return b.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function cu(){const[e,t]=b.useState("");return{announce:b.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const ds=b.createContext(null);function du(e){const t=b.useContext(ds);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function uu(){const[e]=b.useState(()=>new Set),t=b.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[b.useCallback(n=>{let{type:o,event:i}=n;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const fu={draggable:`
209
183
  To pick up a draggable item, press the space bar.
210
184
  While dragging, use the arrow keys to move the item.
211
185
  Press space again to drop the item in its new position, or press escape to cancel.
212
- `},gu={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function bu(e){let{announcements:t=gu,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=mu}=e;const{announce:i,announcement:s}=fu(),a=wr("DndLiveRegion"),[l,c]=N.useState(!1);if(N.useEffect(()=>{c(!0)},[]),pu(N.useMemo(()=>({onDragStart(f){let{active:m}=f;i(t.onDragStart({active:m}))},onDragMove(f){let{active:m,over:p}=f;t.onDragMove&&i(t.onDragMove({active:m,over:p}))},onDragOver(f){let{active:m,over:p}=f;i(t.onDragOver({active:m,over:p}))},onDragEnd(f){let{active:m,over:p}=f;i(t.onDragEnd({active:m,over:p}))},onDragCancel(f){let{active:m,over:p}=f;i(t.onDragCancel({active:m,over:p}))}}),[i,t])),!l)return null;const d=N.createElement(N.Fragment,null,N.createElement(du,{id:n,value:o.draggable}),N.createElement(uu,{id:a,announcement:s}));return r?mt.createPortal(d,r):d}var Re;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Re||(Re={}));function fn(){}function go(e,t){return N.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function vu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return N.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Qe=Object.freeze({x:0,y:0});function ps(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xu(e,t){const r=un(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function hs(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function wu(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function ms(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function gs(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function bs(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const yu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=bs(t,t.left,t.top),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=ps(bs(l),o);i.push({id:a,data:{droppableContainer:s,value:c}})}}return i.sort(hs)},ku=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ms(t),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const c=ms(l),d=o.reduce((m,p,w)=>m+ps(c[w],p),0),f=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:f}})}}return i.sort(hs)};function _u(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-n,a=i-r;if(n<o&&r<i){const l=t.width*t.height,c=e.width*e.height,d=s*a,f=d/(l+c-d);return Number(f.toFixed(4))}return 0}const Su=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const i of n){const{id:s}=i,a=r.get(s);if(a){const l=_u(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(wu)};function Cu(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function vs(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Qe}function Eu(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...r})}}const Nu=Eu(1);function xs(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function zu(e,t,r){const n=xs(t);if(!n)return e;const{scaleX:o,scaleY:i,x:s,y:a}=n,l=e.left-s-(1-o)*parseFloat(r),c=e.top-a-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:c,right:l+d,bottom:c+f,left:l}}const ju={ignoreTransform:!1};function Vt(e,t){t===void 0&&(t=ju);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=$e(e).getComputedStyle(e);c&&(r=zu(r,c,d))}const{top:n,left:o,width:i,height:s,bottom:a,right:l}=r;return{top:n,left:o,width:i,height:s,bottom:a,right:l}}function ws(e){return Vt(e,{ignoreTransform:!0})}function Au(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Tu(e,t){return t===void 0&&(t=$e(e).getComputedStyle(e)),t.position==="fixed"}function Ou(e,t){t===void 0&&(t=$e(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?r.test(i):!1})}function pn(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(ho(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!br(o)||cs(o)||r.includes(o))return r;const i=$e(e).getComputedStyle(o);return o!==e&&Ou(o,i)&&r.push(o),Tu(o,i)?r:n(o.parentNode)}return e?n(e):r}function ys(e){const[t]=pn(e,1);return t??null}function bo(e){return!sn||!e?null:$t(e)?e:po(e)?ho(e)||e===Wt(e).scrollingElement?window:br(e)?e:null:null}function ks(e){return $t(e)?e.scrollX:e.scrollLeft}function _s(e){return $t(e)?e.scrollY:e.scrollTop}function vo(e){return{x:ks(e),y:_s(e)}}var Le;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Le||(Le={}));function Ss(e){return!sn||!e?!1:e===document.scrollingElement}function Cs(e){const t={x:0,y:0},r=Ss(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:n,minScroll:t}}const Iu={x:.2,y:.2};function Pu(e,t,r,n,o){let{top:i,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=Iu);const{isTop:c,isBottom:d,isLeft:f,isRight:m}=Cs(e),p={x:0,y:0},w={x:0,y:0},u={height:t.height*o.y,width:t.width*o.x};return!c&&i<=t.top+u.height?(p.y=Le.Backward,w.y=n*Math.abs((t.top+u.height-i)/u.height)):!d&&l>=t.bottom-u.height&&(p.y=Le.Forward,w.y=n*Math.abs((t.bottom-u.height-l)/u.height)),!m&&a>=t.right-u.width?(p.x=Le.Forward,w.x=n*Math.abs((t.right-u.width-a)/u.width)):!f&&s<=t.left+u.width&&(p.x=Le.Backward,w.x=n*Math.abs((t.left+u.width-s)/u.width)),{direction:p,speed:w}}function Du(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Es(e){return e.reduce((t,r)=>Ht(t,vo(r)),Qe)}function Ru(e){return e.reduce((t,r)=>t+ks(r),0)}function Mu(e){return e.reduce((t,r)=>t+_s(r),0)}function Ns(e,t){if(t===void 0&&(t=Vt),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);ys(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Lu=[["x",["left","right"],Ru],["y",["top","bottom"],Mu]];class xo{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=pn(r),o=Es(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of Lu)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(n),d=o[i]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class kr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Fu(e){const{EventTarget:t}=$e(e);return e instanceof t?e:Wt(e)}function wo(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var qe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(qe||(qe={}));function zs(e){e.preventDefault()}function Bu(e){e.stopPropagation()}var Ee;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ee||(Ee={}));const js={start:[Ee.Space,Ee.Enter],cancel:[Ee.Esc],end:[Ee.Space,Ee.Enter,Ee.Tab]},Uu=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ee.Right:return{...r,x:r.x+25};case Ee.Left:return{...r,x:r.x-25};case Ee.Down:return{...r,y:r.y+25};case Ee.Up:return{...r,y:r.y-25}}};class yo{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new kr(Wt(r)),this.windowListeners=new kr($e(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(qe.Resize,this.handleCancel),this.windowListeners.add(qe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(qe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Ns(n),r(Qe)}handleKeyDown(t){if(dn(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:i=js,coordinateGetter:s=Uu,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=n.current,d=c?{x:c.left,y:c.top}:Qe;this.referenceCoordinates||(this.referenceCoordinates=d);const f=s(t,{active:r,context:n.current,currentCoordinates:d});if(f){const m=yr(f,d),p={x:0,y:0},{scrollableAncestors:w}=n.current;for(const u of w){const g=t.code,{isTop:b,isRight:v,isLeft:k,isBottom:_,maxScroll:S,minScroll:O}=Cs(u),z=Du(u),I={x:Math.min(g===Ee.Right?z.right-z.width/2:z.right,Math.max(g===Ee.Right?z.left:z.left+z.width/2,f.x)),y:Math.min(g===Ee.Down?z.bottom-z.height/2:z.bottom,Math.max(g===Ee.Down?z.top:z.top+z.height/2,f.y))},D=g===Ee.Right&&!v||g===Ee.Left&&!k,U=g===Ee.Down&&!_||g===Ee.Up&&!b;if(D&&I.x!==f.x){const H=u.scrollLeft+m.x,C=g===Ee.Right&&H<=S.x||g===Ee.Left&&H>=O.x;if(C&&!m.y){u.scrollTo({left:H,behavior:a});return}C?p.x=u.scrollLeft-H:p.x=g===Ee.Right?u.scrollLeft-S.x:u.scrollLeft-O.x,p.x&&u.scrollBy({left:-p.x,behavior:a});break}else if(U&&I.y!==f.y){const H=u.scrollTop+m.y,C=g===Ee.Down&&H<=S.y||g===Ee.Up&&H>=O.y;if(C&&!m.x){u.scrollTo({top:H,behavior:a});return}C?p.y=u.scrollTop-H:p.y=g===Ee.Down?u.scrollTop-S.y:u.scrollTop-O.y,p.y&&u.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,Ht(yr(f,this.referenceCoordinates),p))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}yo.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=js,onActivation:o}=t,{active:i}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function As(e){return!!(e&&"distance"in e)}function Ts(e){return!!(e&&"delay"in e)}class ko{constructor(t,r,n){var o;n===void 0&&(n=Fu(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:s}=i;this.props=t,this.events=r,this.document=Wt(s),this.documentListeners=new kr(this.document),this.listeners=new kr(n),this.windowListeners=new kr($e(s)),this.initialCoordinates=(o=un(i))!=null?o:Qe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(qe.Resize,this.handleCancel),this.windowListeners.add(qe.DragStart,zs),this.windowListeners.add(qe.VisibilityChange,this.handleCancel),this.windowListeners.add(qe.ContextMenu,zs),this.documentListeners.add(qe.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ts(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(As(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(qe.Click,Bu,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(qe.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(r=un(t))!=null?r:Qe,c=yr(o,l);if(!n&&a){if(As(a)){if(a.tolerance!=null&&wo(c,a.tolerance))return this.handleCancel();if(wo(c,a.distance))return this.handleStart()}if(Ts(a)&&wo(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ee.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const $u={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class _o extends ko{constructor(t){const{event:r}=t,n=Wt(r.target);super(t,$u,n)}}_o.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Wu={move:{name:"mousemove"},end:{name:"mouseup"}};var So;(function(e){e[e.RightClick=2]="RightClick"})(So||(So={}));class Hu extends ko{constructor(t){super(t,Wu,Wt(t.event.target))}}Hu.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===So.RightClick?!1:(n==null||n({event:r}),!0)}}];const Co={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Os extends ko{constructor(t){super(t,Co)}static setup(){return window.addEventListener(Co.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Co.move.name,t)};function t(){}}}Os.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var _r;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(_r||(_r={}));var hn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(hn||(hn={}));function Vu(e){let{acceleration:t,activator:r=_r.Pointer,canScroll:n,draggingRect:o,enabled:i,interval:s=5,order:a=hn.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:f,threshold:m}=e;const p=Gu({delta:f,disabled:!i}),[w,u]=iu(),g=N.useRef({x:0,y:0}),b=N.useRef({x:0,y:0}),v=N.useMemo(()=>{switch(r){case _r.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case _r.DraggableRect:return o}},[r,o,l]),k=N.useRef(null),_=N.useCallback(()=>{const O=k.current;if(!O)return;const z=g.current.x*b.current.x,I=g.current.y*b.current.y;O.scrollBy(z,I)},[]),S=N.useMemo(()=>a===hn.TreeOrder?[...c].reverse():c,[a,c]);N.useEffect(()=>{if(!i||!c.length||!v){u();return}for(const O of S){if((n==null?void 0:n(O))===!1)continue;const z=c.indexOf(O),I=d[z];if(!I)continue;const{direction:D,speed:U}=Pu(O,I,v,t,m);for(const H of["x","y"])p[H][D[H]]||(U[H]=0,D[H]=0);if(U.x>0||U.y>0){u(),k.current=O,w(_,s),g.current=U,b.current=D;return}}g.current={x:0,y:0},b.current={x:0,y:0},u()},[t,_,n,u,i,s,JSON.stringify(v),JSON.stringify(p),w,c,S,d,JSON.stringify(m)])}const Zu={x:{[Le.Backward]:!1,[Le.Forward]:!1},y:{[Le.Backward]:!1,[Le.Forward]:!1}};function Gu(e){let{delta:t,disabled:r}=e;const n=cn(t);return xr(o=>{if(r||!n||!o)return Zu;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Le.Backward]:o.x[Le.Backward]||i.x===-1,[Le.Forward]:o.x[Le.Forward]||i.x===1},y:{[Le.Backward]:o.y[Le.Backward]||i.y===-1,[Le.Forward]:o.y[Le.Forward]||i.y===1}}},[r,t,n])}function Ku(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return xr(o=>{var i;return t==null?null:(i=n??o)!=null?i:null},[n,t])}function Yu(e,t){return N.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...i]},[]),[e,t])}var Sr;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Sr||(Sr={}));var Eo;(function(e){e.Optimized="optimized"})(Eo||(Eo={}));const Is=new Map;function qu(e,t){let{dragging:r,dependencies:n,config:o}=t;const[i,s]=N.useState(null),{frequency:a,measure:l,strategy:c}=o,d=N.useRef(e),f=g(),m=vr(f),p=N.useCallback(function(b){b===void 0&&(b=[]),!m.current&&s(v=>v===null?b:v.concat(b.filter(k=>!v.includes(k))))},[m]),w=N.useRef(null),u=xr(b=>{if(f&&!r)return Is;if(!b||b===Is||d.current!==e||i!=null){const v=new Map;for(let k of e){if(!k)continue;if(i&&i.length>0&&!i.includes(k.id)&&k.rect.current){v.set(k.id,k.rect.current);continue}const _=k.node.current,S=_?new xo(l(_),_):null;k.rect.current=S,S&&v.set(k.id,S)}return v}return b},[e,i,r,f,l]);return N.useEffect(()=>{d.current=e},[e]),N.useEffect(()=>{f||p()},[r,f]),N.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),N.useEffect(()=>{f||typeof a!="number"||w.current!==null||(w.current=setTimeout(()=>{p(),w.current=null},a))},[a,f,p,...n]),{droppableRects:u,measureDroppableContainers:p,measuringScheduled:i!=null};function g(){switch(c){case Sr.Always:return!1;case Sr.BeforeDragging:return r;default:return!r}}}function No(e,t){return xr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Xu(e,t){return No(e,t)}function Ju(e){let{callback:t,disabled:r}=e;const n=an(t),o=N.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return N.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function mn(e){let{callback:t,disabled:r}=e;const n=an(t),o=N.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return N.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Qu(e){return new xo(Vt(e),e)}function Ps(e,t,r){t===void 0&&(t=Qu);const[n,o]=N.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??r)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const s=Ju({callback(l){if(e)for(const c of l){const{type:d,target:f}=c;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=mn({callback:i});return Je(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),n}function ef(e){const t=No(e);return vs(e,t)}const Ds=[];function tf(e){const t=N.useRef(e),r=xr(n=>e?n&&n!==Ds&&e&&t.current&&e.parentNode===t.current.parentNode?n:pn(e):Ds,[e]);return N.useEffect(()=>{t.current=e},[e]),r}function rf(e){const[t,r]=N.useState(null),n=N.useRef(e),o=N.useCallback(i=>{const s=bo(i.target);s&&r(a=>a?(a.set(s,vo(s)),new Map(a)):null)},[]);return N.useEffect(()=>{const i=n.current;if(e!==i){s(i);const a=e.map(l=>{const c=bo(l);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,vo(c)]):null}).filter(l=>l!=null);r(a.length?new Map(a):null),n.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const c=bo(l);c==null||c.removeEventListener("scroll",o)})}},[o,e]),N.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Ht(i,s),Qe):Es(e):Qe,[e,t])}function Rs(e,t){t===void 0&&(t=[]);const r=N.useRef(null);return N.useEffect(()=>{r.current=null},t),N.useEffect(()=>{const n=e!==Qe;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?yr(e,r.current):Qe}function nf(e){N.useEffect(()=>{if(!sn)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function of(e,t){return N.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:i}=n;return r[o]=s=>{i(s,t)},r},{}),[e,t])}function Ms(e){return N.useMemo(()=>e?Au(e):null,[e])}const Ls=[];function sf(e,t){t===void 0&&(t=Vt);const[r]=e,n=Ms(r?$e(r):null),[o,i]=N.useState(Ls);function s(){i(()=>e.length?e.map(l=>Ss(l)?n:new xo(t(l),l)):Ls)}const a=mn({callback:s});return Je(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function Fs(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return br(t)?t:e}function af(e){let{measure:t}=e;const[r,n]=N.useState(null),o=N.useCallback(c=>{for(const{target:d}of c)if(br(d)){n(f=>{const m=t(d);return f?{...f,width:m.width,height:m.height}:m});break}},[t]),i=mn({callback:o}),s=N.useCallback(c=>{const d=Fs(c);i==null||i.disconnect(),d&&(i==null||i.observe(d)),n(d?t(d):null)},[t,i]),[a,l]=ln(s);return N.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const lf=[{sensor:_o,options:{}},{sensor:yo,options:{}}],cf={current:{}},gn={draggable:{measure:ws},droppable:{measure:ws,strategy:Sr.WhileDragging,frequency:Eo.Optimized},dragOverlay:{measure:Vt}};class Cr extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const df={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Cr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:fn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:gn,measureDroppableContainers:fn,windowRect:null,measuringScheduled:!1},Bs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:fn,draggableNodes:new Map,over:null,measureDroppableContainers:fn},Er=N.createContext(Bs),Us=N.createContext(df);function uf(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Cr}}}function ff(e,t){switch(t.type){case Re.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Re.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Re.DragEnd:case Re.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Re.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new Cr(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case Re.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const s=new Cr(e.droppable.containers);return s.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case Re.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new Cr(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function pf(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=N.useContext(Er),i=cn(n),s=cn(r==null?void 0:r.id);return N.useEffect(()=>{if(!t&&!n&&i&&s!=null){if(!dn(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const f=lu(d);if(f){f.focus();break}}})}},[n,t,o,s,i]),null}function $s(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...n}),r):r}function hf(e){return N.useMemo(()=>({draggable:{...gn.draggable,...e==null?void 0:e.draggable},droppable:{...gn.droppable,...e==null?void 0:e.droppable},dragOverlay:{...gn.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function mf(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const i=N.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Je(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!n)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const d=r(c),f=vs(d,n);if(s||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const m=ys(c);m&&m.scrollBy({top:f.y,left:f.x})}},[t,s,a,n,r])}const bn=N.createContext({...Qe,scaleX:1,scaleY:1});var xt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(xt||(xt={}));const gf=N.memo(function(t){var r,n,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:d=lf,collisionDetection:f=Su,measuring:m,modifiers:p,...w}=t;const u=N.useReducer(ff,void 0,uf),[g,b]=u,[v,k]=hu(),[_,S]=N.useState(xt.Uninitialized),O=_===xt.Initialized,{draggable:{active:z,nodes:I,translate:D},droppable:{containers:U}}=g,H=z!=null?I.get(z):null,C=N.useRef({initial:null,translated:null}),M=N.useMemo(()=>{var Ie;return z!=null?{id:z,data:(Ie=H==null?void 0:H.data)!=null?Ie:cf,rect:C}:null},[z,H]),y=N.useRef(null),[L,Q]=N.useState(null),[F,$]=N.useState(null),V=vr(w,Object.values(w)),re=wr("DndDescribedBy",s),A=N.useMemo(()=>U.getEnabled(),[U]),P=hf(m),{droppableRects:J,measureDroppableContainers:G,measuringScheduled:te}=qu(A,{dragging:O,dependencies:[D.x,D.y],config:P.droppable}),ce=Ku(I,z),q=N.useMemo(()=>F?un(F):null,[F]),ie=eo(),ue=Xu(ce,P.draggable.measure);mf({activeNode:z!=null?I.get(z):null,config:ie.layoutShiftCompensation,initialRect:ue,measure:P.draggable.measure});const ae=Ps(ce,P.draggable.measure,ue),pe=Ps(ce?ce.parentElement:null),ve=N.useRef({activatorEvent:null,active:null,activeNode:ce,collisionRect:null,collisions:null,droppableRects:J,draggableNodes:I,draggingNode:null,draggingNodeRect:null,droppableContainers:U,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),_e=U.getNodeFor((r=ve.current.over)==null?void 0:r.id),x=af({measure:P.dragOverlay.measure}),K=(n=x.nodeRef.current)!=null?n:ce,W=O?(o=x.rect)!=null?o:ae:null,T=!!(x.nodeRef.current&&x.rect),j=ef(T?null:ae),R=Ms(K?$e(K):null),Y=tf(O?_e??ce:null),X=sf(Y),B=$s(p,{transform:{x:D.x-j.x,y:D.y-j.y,scaleX:1,scaleY:1},activatorEvent:F,active:M,activeNodeRect:ae,containerNodeRect:pe,draggingNodeRect:W,over:ve.current.over,overlayNodeRect:x.rect,scrollableAncestors:Y,scrollableAncestorRects:X,windowRect:R}),ne=q?Ht(q,D):null,fe=rf(Y),se=Rs(fe),Z=Rs(fe,[ae]),de=Ht(B,se),le=W?Nu(W,B):null,we=M&&le?f({active:M,collisionRect:le,droppableRects:J,droppableContainers:A,pointerCoordinates:ne}):null,ee=gs(we,"id"),[oe,ge]=N.useState(null),be=T?B:Ht(B,Z),xe=Cu(be,(i=oe==null?void 0:oe.rect)!=null?i:null,ae),je=N.useRef(null),Se=N.useCallback((Ie,Fe)=>{let{sensor:Ge,options:Et}=Fe;if(y.current==null)return;const Xe=I.get(y.current);if(!Xe)return;const Ke=Ie.nativeEvent,lt=new Ge({active:y.current,activeNode:Xe,event:Ke,options:Et,context:ve,onAbort(Be){if(!I.get(Be))return;const{onDragAbort:ct}=V.current,ht={id:Be};ct==null||ct(ht),v({type:"onDragAbort",event:ht})},onPending(Be,Nt,ct,ht){if(!I.get(Be))return;const{onDragPending:Ur}=V.current,zt={id:Be,constraint:Nt,initialCoordinates:ct,offset:ht};Ur==null||Ur(zt),v({type:"onDragPending",event:zt})},onStart(Be){const Nt=y.current;if(Nt==null)return;const ct=I.get(Nt);if(!ct)return;const{onDragStart:ht}=V.current,Br={activatorEvent:Ke,active:{id:Nt,data:ct.data,rect:C}};mt.unstable_batchedUpdates(()=>{ht==null||ht(Br),S(xt.Initializing),b({type:Re.DragStart,initialCoordinates:Be,active:Nt}),v({type:"onDragStart",event:Br}),Q(je.current),$(Ke)})},onMove(Be){b({type:Re.DragMove,coordinates:Be})},onEnd:lr(Re.DragEnd),onCancel:lr(Re.DragCancel)});je.current=lt;function lr(Be){return async function(){const{active:ct,collisions:ht,over:Br,scrollAdjustedTranslate:Ur}=ve.current;let zt=null;if(ct&&Ur){const{cancelDrop:$r}=V.current;zt={activatorEvent:Ke,active:ct,collisions:ht,delta:Ur,over:Br},Be===Re.DragEnd&&typeof $r=="function"&&await Promise.resolve($r(zt))&&(Be=Re.DragCancel)}y.current=null,mt.unstable_batchedUpdates(()=>{b({type:Be}),S(xt.Uninitialized),ge(null),Q(null),$(null),je.current=null;const $r=Be===Re.DragEnd?"onDragEnd":"onDragCancel";if(zt){const Si=V.current[$r];Si==null||Si(zt),v({type:$r,event:zt})}})}}},[I]),Me=N.useCallback((Ie,Fe)=>(Ge,Et)=>{const Xe=Ge.nativeEvent,Ke=I.get(Et);if(y.current!==null||!Ke||Xe.dndKit||Xe.defaultPrevented)return;const lt={active:Ke};Ie(Ge,Fe.options,lt)===!0&&(Xe.dndKit={capturedBy:Fe.sensor},y.current=Et,Se(Ge,Fe))},[I,Se]),pt=Yu(d,Me);nf(d),Je(()=>{ae&&_===xt.Initializing&&S(xt.Initialized)},[ae,_]),N.useEffect(()=>{const{onDragMove:Ie}=V.current,{active:Fe,activatorEvent:Ge,collisions:Et,over:Xe}=ve.current;if(!Fe||!Ge)return;const Ke={active:Fe,activatorEvent:Ge,collisions:Et,delta:{x:de.x,y:de.y},over:Xe};mt.unstable_batchedUpdates(()=>{Ie==null||Ie(Ke),v({type:"onDragMove",event:Ke})})},[de.x,de.y]),N.useEffect(()=>{const{active:Ie,activatorEvent:Fe,collisions:Ge,droppableContainers:Et,scrollAdjustedTranslate:Xe}=ve.current;if(!Ie||y.current==null||!Fe||!Xe)return;const{onDragOver:Ke}=V.current,lt=Et.get(ee),lr=lt&&lt.rect.current?{id:lt.id,rect:lt.rect.current,data:lt.data,disabled:lt.disabled}:null,Be={active:Ie,activatorEvent:Fe,collisions:Ge,delta:{x:Xe.x,y:Xe.y},over:lr};mt.unstable_batchedUpdates(()=>{ge(lr),Ke==null||Ke(Be),v({type:"onDragOver",event:Be})})},[ee]),Je(()=>{ve.current={activatorEvent:F,active:M,activeNode:ce,collisionRect:le,collisions:we,droppableRects:J,draggableNodes:I,draggingNode:K,draggingNodeRect:W,droppableContainers:U,over:oe,scrollableAncestors:Y,scrollAdjustedTranslate:de},C.current={initial:W,translated:le}},[M,ce,we,le,I,K,W,J,U,oe,Y,de]),Vu({...ie,delta:D,draggingRect:le,pointerCoordinates:ne,scrollableAncestors:Y,scrollableAncestorRects:X});const ki=N.useMemo(()=>({active:M,activeNode:ce,activeNodeRect:ae,activatorEvent:F,collisions:we,containerNodeRect:pe,dragOverlay:x,draggableNodes:I,droppableContainers:U,droppableRects:J,over:oe,measureDroppableContainers:G,scrollableAncestors:Y,scrollableAncestorRects:X,measuringConfiguration:P,measuringScheduled:te,windowRect:R}),[M,ce,ae,F,we,pe,x,I,U,J,oe,G,Y,X,P,te,R]),_i=N.useMemo(()=>({activatorEvent:F,activators:pt,active:M,activeNodeRect:ae,ariaDescribedById:{draggable:re},dispatch:b,draggableNodes:I,over:oe,measureDroppableContainers:G}),[F,pt,M,ae,b,re,I,oe,G]);return N.createElement(fs.Provider,{value:k},N.createElement(Er.Provider,{value:_i},N.createElement(Us.Provider,{value:ki},N.createElement(bn.Provider,{value:xe},c)),N.createElement(pf,{disabled:(a==null?void 0:a.restoreFocus)===!1})),N.createElement(bu,{...a,hiddenTextDescribedById:re}));function eo(){const Ie=(L==null?void 0:L.autoScrollEnabled)===!1,Fe=typeof l=="object"?l.enabled===!1:l===!1,Ge=O&&!Ie&&!Fe;return typeof l=="object"?{...l,enabled:Ge}:{enabled:Ge}}}),bf=N.createContext(null),Ws="button",vf="Draggable";function xf(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const i=wr(vf),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:f,over:m}=N.useContext(Er),{role:p=Ws,roleDescription:w="draggable",tabIndex:u=0}=o??{},g=(l==null?void 0:l.id)===t,b=N.useContext(g?bn:bf),[v,k]=ln(),[_,S]=ln(),O=of(s,t),z=vr(r);Je(()=>(f.set(t,{id:t,key:i,node:v,activatorNode:_,data:z}),()=>{const D=f.get(t);D&&D.key===i&&f.delete(t)}),[f,t]);const I=N.useMemo(()=>({role:p,tabIndex:u,"aria-disabled":n,"aria-pressed":g&&p===Ws?!0:void 0,"aria-roledescription":w,"aria-describedby":d.draggable}),[n,p,u,g,w,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:I,isDragging:g,listeners:n?void 0:O,node:v,over:m,setNodeRef:k,setActivatorNodeRef:S,transform:b}}function Hs(){return N.useContext(Us)}const wf="Droppable",yf={timeout:25};function kf(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const i=wr(wf),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=N.useContext(Er),d=N.useRef({disabled:r}),f=N.useRef(!1),m=N.useRef(null),p=N.useRef(null),{disabled:w,updateMeasurementsFor:u,timeout:g}={...yf,...o},b=vr(u??n),v=N.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(b.current)?b.current:[b.current]),p.current=null},g)},[g]),k=mn({callback:v,disabled:w||!s}),_=N.useCallback((I,D)=>{k&&(D&&(k.unobserve(D),f.current=!1),I&&k.observe(I))},[k]),[S,O]=ln(_),z=vr(t);return N.useEffect(()=>{!k||!S.current||(k.disconnect(),f.current=!1,k.observe(S.current))},[S,k]),N.useEffect(()=>(a({type:Re.RegisterDroppable,element:{id:n,key:i,disabled:r,node:S,rect:m,data:z}}),()=>a({type:Re.UnregisterDroppable,key:i,id:n})),[n]),N.useEffect(()=>{r!==d.current.disabled&&(a({type:Re.SetDroppableDisabled,id:n,key:i,disabled:r}),d.current.disabled=r)},[n,i,r,a]),{active:s,rect:m,isOver:(l==null?void 0:l.id)===n,node:S,over:l,setNodeRef:O}}function _f(e){let{animation:t,children:r}=e;const[n,o]=N.useState(null),[i,s]=N.useState(null),a=cn(r);return!r&&!n&&a&&o(a),Je(()=>{if(!i)return;const l=n==null?void 0:n.key,c=n==null?void 0:n.props.id;if(l==null||c==null){o(null);return}Promise.resolve(t(c,i)).then(()=>{o(null)})},[t,n,i]),N.createElement(N.Fragment,null,r,n?N.cloneElement(n,{ref:s}):null)}const Sf={x:0,y:0,scaleX:1,scaleY:1};function Cf(e){let{children:t}=e;return N.createElement(Er.Provider,{value:Bs},N.createElement(bn.Provider,{value:Sf},t))}const Ef={position:"fixed",touchAction:"none"},Nf=e=>dn(e)?"transform 250ms ease":void 0,zf=N.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:i,className:s,rect:a,style:l,transform:c,transition:d=Nf}=e;if(!a)return null;const f=o?c:{...c,scaleX:1,scaleY:1},m={...Ef,width:a.width,height:a.height,top:a.top,left:a.left,transform:vt.Transform.toString(f),transformOrigin:o&&n?xu(n,a):void 0,transition:typeof d=="function"?d(n):d,...l};return N.createElement(r,{className:s,style:m,ref:t},i)}),jf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:vt.Transform.toString(t)},{transform:vt.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(o[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&n.node.style.setProperty(a,l);return s!=null&&s.active&&r.node.classList.add(s.active),s!=null&&s.dragOverlay&&n.node.classList.add(s.dragOverlay),function(){for(const[l,c]of Object.entries(o))r.node.style.setProperty(l,c);s!=null&&s.active&&r.node.classList.remove(s.active)}})({styles:{active:{opacity:"0"}}})};function Af(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return an((i,s)=>{if(t===null)return;const a=r.get(i);if(!a)return;const l=a.node.current;if(!l)return;const c=Fs(s);if(!c)return;const{transform:d}=$e(s).getComputedStyle(s),f=xs(d);if(!f)return;const m=typeof t=="function"?t:Tf(t);return Ns(l,o.draggable.measure),m({active:{id:i,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:s,rect:o.dragOverlay.measure(c)},droppableContainers:n,measuringConfiguration:o,transform:f})})}function Tf(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...jf,...e};return i=>{let{active:s,dragOverlay:a,transform:l,...c}=i;if(!t)return;const d={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},f={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},m={x:l.x-d.x,y:l.y-d.y,...f},p=o({...c,active:s,dragOverlay:a,transform:{initial:l,final:m}}),[w]=p,u=p[p.length-1];if(JSON.stringify(w)===JSON.stringify(u))return;const g=n==null?void 0:n({active:s,dragOverlay:a,...c}),b=a.node.animate(p,{duration:t,easing:r,fill:"forwards"});return new Promise(v=>{b.onfinish=()=>{g==null||g(),v()}})}}let Vs=0;function Of(e){return N.useMemo(()=>{if(e!=null)return Vs++,Vs},[e])}const If=N.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:f,activeNodeRect:m,containerNodeRect:p,draggableNodes:w,droppableContainers:u,dragOverlay:g,over:b,measuringConfiguration:v,scrollableAncestors:k,scrollableAncestorRects:_,windowRect:S}=Hs(),O=N.useContext(bn),z=Of(f==null?void 0:f.id),I=$s(s,{activatorEvent:d,active:f,activeNodeRect:m,containerNodeRect:p,draggingNodeRect:g.rect,over:b,overlayNodeRect:g.rect,scrollableAncestors:k,scrollableAncestorRects:_,transform:O,windowRect:S}),D=No(m),U=Af({config:n,draggableNodes:w,droppableContainers:u,measuringConfiguration:v}),H=D?g.setRef:void 0;return N.createElement(Cf,null,N.createElement(_f,{animation:U},f&&z?N.createElement(zf,{key:z,id:f.id,ref:H,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:D,style:{zIndex:c,...o},transform:I},r):null))}),Pf=e=>{let{transform:t}=e;return{...t,x:0}};function Zs(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Df(e,t){return e.reduce((r,n,o)=>{const i=t.get(n);return i&&(r[o]=i),r},Array(e.length))}function vn(e){return e!==null&&e>=0}function Rf(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Mf(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Gs=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=Zs(t,n,r),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},xn={scaleX:1,scaleY:1},Lf=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:i,overIndex:s}=e;const a=(t=i[r])!=null?t:n;if(!a)return null;if(o===r){const c=i[s];return c?{x:0,y:r<s?c.top+c.height-(a.top+a.height):c.top-a.top,...xn}:null}const l=Ff(i,o,r);return o>r&&o<=s?{x:0,y:-a.height-l,...xn}:o<r&&o>=s?{x:0,y:a.height+l,...xn}:{x:0,y:0,...xn}};function Ff(e,t,r){const n=e[t],o=e[t-1],i=e[t+1];return n?r<t?o?n.top-(o.top+o.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Ks="Sortable",Ys=N.createContext({activeIndex:-1,containerId:Ks,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Gs,disabled:{draggable:!1,droppable:!1}});function Bf(e){let{children:t,id:r,items:n,strategy:o=Gs,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=Hs(),f=wr(Ks,r),m=a.rect!==null,p=N.useMemo(()=>n.map(O=>typeof O=="object"&&"id"in O?O.id:O),[n]),w=s!=null,u=s?p.indexOf(s.id):-1,g=c?p.indexOf(c.id):-1,b=N.useRef(p),v=!Rf(p,b.current),k=g!==-1&&u===-1||v,_=Mf(i);Je(()=>{v&&w&&d(p)},[v,p,w,d]),N.useEffect(()=>{b.current=p},[p]);const S=N.useMemo(()=>({activeIndex:u,containerId:f,disabled:_,disableTransforms:k,items:p,overIndex:g,useDragOverlay:m,sortedRects:Df(p,l),strategy:o}),[u,f,_.draggable,_.droppable,k,p,g,l,m,o]);return N.createElement(Ys.Provider,{value:S},t)}const Uf=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Zs(r,n,o).indexOf(t)},$f=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!n||a!==i&&o===s?!1:r?!0:s!==o&&t===l},Wf={duration:200,easing:"ease"},qs="transform",Hf=vt.Transition.toString({property:qs,duration:0,easing:"linear"}),Vf={roleDescription:"sortable"};function Zf(e){let{disabled:t,index:r,node:n,rect:o}=e;const[i,s]=N.useState(null),a=N.useRef(r);return Je(()=>{if(!t&&r!==a.current&&n.current){const l=o.current;if(l){const c=Vt(n.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&s(d)}}r!==a.current&&(a.current=r)},[t,r,n,o]),N.useEffect(()=>{i&&s(null)},[i]),i}function Gf(e){let{animateLayoutChanges:t=$f,attributes:r,disabled:n,data:o,getNewIndex:i=Uf,id:s,strategy:a,resizeObserverConfig:l,transition:c=Wf}=e;const{items:d,containerId:f,activeIndex:m,disabled:p,disableTransforms:w,sortedRects:u,overIndex:g,useDragOverlay:b,strategy:v}=N.useContext(Ys),k=Kf(n,p),_=d.indexOf(s),S=N.useMemo(()=>({sortable:{containerId:f,index:_,items:d},...o}),[f,o,_,d]),O=N.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:z,node:I,isOver:D,setNodeRef:U}=kf({id:s,data:S,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...l}}),{active:H,activatorEvent:C,activeNodeRect:M,attributes:y,setNodeRef:L,listeners:Q,isDragging:F,over:$,setActivatorNodeRef:V,transform:re}=xf({id:s,data:S,attributes:{...Vf,...r},disabled:k.draggable}),A=ou(U,L),P=!!H,J=P&&!w&&vn(m)&&vn(g),G=!b&&F,te=G&&J?re:null,q=J?te??(a??v)({rects:u,activeNodeRect:M,activeIndex:m,overIndex:g,index:_}):null,ie=vn(m)&&vn(g)?i({id:s,items:d,activeIndex:m,overIndex:g}):_,ue=H==null?void 0:H.id,ae=N.useRef({activeId:ue,items:d,newIndex:ie,containerId:f}),pe=d!==ae.current.items,ve=t({active:H,containerId:f,isDragging:F,isSorting:P,id:s,index:_,items:d,newIndex:ae.current.newIndex,previousItems:ae.current.items,previousContainerId:ae.current.containerId,transition:c,wasDragging:ae.current.activeId!=null}),_e=Zf({disabled:!ve,index:_,node:I,rect:z});return N.useEffect(()=>{P&&ae.current.newIndex!==ie&&(ae.current.newIndex=ie),f!==ae.current.containerId&&(ae.current.containerId=f),d!==ae.current.items&&(ae.current.items=d)},[P,ie,f,d]),N.useEffect(()=>{if(ue===ae.current.activeId)return;if(ue!=null&&ae.current.activeId==null){ae.current.activeId=ue;return}const K=setTimeout(()=>{ae.current.activeId=ue},50);return()=>clearTimeout(K)},[ue]),{active:H,activeIndex:m,attributes:y,data:S,rect:z,index:_,newIndex:ie,items:d,isOver:D,isSorting:P,isDragging:F,listeners:Q,node:I,overIndex:g,over:$,setNodeRef:A,setActivatorNodeRef:V,setDroppableNodeRef:U,setDraggableNodeRef:L,transform:_e??q,transition:x()};function x(){if(_e||pe&&ae.current.newIndex===_)return Hf;if(!(G&&!dn(C)||!c)&&(P||ve))return vt.Transition.toString({...c,property:qs})}}function Kf(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function wn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Yf=[Ee.Down,Ee.Right,Ee.Up,Ee.Left],qf=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(Yf.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const m=o.get(f.id);if(m)switch(e.code){case Ee.Down:n.top<m.top&&l.push(f);break;case Ee.Up:n.top>m.top&&l.push(f);break;case Ee.Left:n.left>m.left&&l.push(f);break;case Ee.Right:n.left<m.left&&l.push(f);break}});const c=ku({collisionRect:n,droppableRects:o,droppableContainers:l});let d=gs(c,"id");if(d===(s==null?void 0:s.id)&&c.length>1&&(d=c[1].id),d!=null){const f=i.get(r.id),m=i.get(d),p=m?o.get(m.id):null,w=m==null?void 0:m.node.current;if(w&&p&&f&&m){const g=pn(w).some((O,z)=>a[z]!==O),b=Xs(f,m),v=Xf(f,m),k=g||!b?{x:0,y:0}:{x:v?n.width-p.width:0,y:v?n.height-p.height:0},_={x:p.left,y:p.top};return k.x&&k.y?_:yr(_,k)}}}};function Xs(e,t){return!wn(e)||!wn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Xf(e,t){return!wn(e)||!wn(t)||!Xs(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function zo({className:e,type:t,...r}){return h.jsx("input",{type:t,className:ye("h-8 rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-1 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600",e),...r})}function Jf({className:e,...t}){return h.jsx("textarea",{className:ye("min-h-16 w-full rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-2 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600 resize-none",e),...t})}function Qf({className:e,checked:t,onCheckedChange:r,...n}){return h.jsx("input",{type:"checkbox",checked:t,onChange:o=>r==null?void 0:r(o.target.checked),className:ye("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function Tt({className:e,...t}){return h.jsx("label",{className:ye("text-sm font-medium leading-none select-none",e),...t})}function Js(e,[t,r]){return Math.min(r,Math.max(t,e))}function ze(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Nr(e,t=[]){let r=[];function n(i,s){const a=E.createContext(s),l=r.length;r=[...r,s];const c=f=>{var b;const{scope:m,children:p,...w}=f,u=((b=m==null?void 0:m[e])==null?void 0:b[l])||a,g=E.useMemo(()=>w,Object.values(w));return h.jsx(u.Provider,{value:g,children:p})};c.displayName=i+"Provider";function d(f,m){var u;const p=((u=m==null?void 0:m[e])==null?void 0:u[l])||a,w=E.useContext(p);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[c,d]}const o=()=>{const i=r.map(s=>E.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return E.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,ep(o,...t)]}function ep(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function Qs(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ea(...e){return t=>{let r=!1;const n=e.map(o=>{const i=Qs(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():Qs(e[o],null)}}}}function Oe(...e){return E.useCallback(ea(...e),e)}function Zt(e){const t=rp(e),r=E.forwardRef((n,o)=>{const{children:i,...s}=n,a=E.Children.toArray(i),l=a.find(op);if(l){const c=l.props.children,d=a.map(f=>f===l?E.Children.count(c)>1?E.Children.only(null):E.isValidElement(c)?c.props.children:null:f);return h.jsx(t,{...s,ref:o,children:E.isValidElement(c)?E.cloneElement(c,void 0,d):null})}return h.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var tp=Zt("Slot");function rp(e){const t=E.forwardRef((r,n)=>{const{children:o,...i}=r;if(E.isValidElement(o)){const s=sp(o),a=ip(i,o.props);return o.type!==E.Fragment&&(a.ref=n?ea(n,s):s),E.cloneElement(o,a)}return E.Children.count(o)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ta=Symbol("radix.slottable");function np(e){const t=({children:r})=>h.jsx(h.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=ta,t}function op(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ta}function ip(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function sp(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function ap(e){const t=e+"CollectionProvider",[r,n]=Nr(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=u=>{const{scope:g,children:b}=u,v=N.useRef(null),k=N.useRef(new Map).current;return h.jsx(o,{scope:g,itemMap:k,collectionRef:v,children:b})};s.displayName=t;const a=e+"CollectionSlot",l=Zt(a),c=N.forwardRef((u,g)=>{const{scope:b,children:v}=u,k=i(a,b),_=Oe(g,k.collectionRef);return h.jsx(l,{ref:_,children:v})});c.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",m=Zt(d),p=N.forwardRef((u,g)=>{const{scope:b,children:v,...k}=u,_=N.useRef(null),S=Oe(g,_),O=i(d,b);return N.useEffect(()=>(O.itemMap.set(_,{ref:_,...k}),()=>void O.itemMap.delete(_))),h.jsx(m,{[f]:"",ref:S,children:v})});p.displayName=d;function w(u){const g=i(e+"CollectionConsumer",u);return N.useCallback(()=>{const v=g.collectionRef.current;if(!v)return[];const k=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(g.itemMap.values()).sort((O,z)=>k.indexOf(O.ref.current)-k.indexOf(z.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:s,Slot:c,ItemSlot:p},w,n]}var lp=E.createContext(void 0);function cp(e){const t=E.useContext(lp);return e||t||"ltr"}var dp=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Te=dp.reduce((e,t)=>{const r=Zt(`Primitive.${t}`),n=E.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function up(e,t){e&&Wr.flushSync(()=>e.dispatchEvent(t))}function Ot(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function fp(e,t=globalThis==null?void 0:globalThis.document){const r=Ot(e);E.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var pp="DismissableLayer",jo="dismissableLayer.update",hp="dismissableLayer.pointerDownOutside",mp="dismissableLayer.focusOutside",ra,na=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yn=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=E.useContext(na),[d,f]=E.useState(null),m=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=E.useState({}),w=Oe(t,z=>f(z)),u=Array.from(c.layers),[g]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=u.indexOf(g),v=d?u.indexOf(d):-1,k=c.layersWithOutsidePointerEventsDisabled.size>0,_=v>=b,S=vp(z=>{const I=z.target,D=[...c.branches].some(U=>U.contains(I));!_||D||(o==null||o(z),s==null||s(z),z.defaultPrevented||a==null||a())},m),O=xp(z=>{const I=z.target;[...c.branches].some(U=>U.contains(I))||(i==null||i(z),s==null||s(z),z.defaultPrevented||a==null||a())},m);return fp(z=>{v===c.layers.size-1&&(n==null||n(z),!z.defaultPrevented&&a&&(z.preventDefault(),a()))},m),E.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(ra=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),oa(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=ra)}},[d,m,r,c]),E.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),oa())},[d,c]),E.useEffect(()=>{const z=()=>p({});return document.addEventListener(jo,z),()=>document.removeEventListener(jo,z)},[]),h.jsx(Te.div,{...l,ref:w,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:ze(e.onFocusCapture,O.onFocusCapture),onBlurCapture:ze(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:ze(e.onPointerDownCapture,S.onPointerDownCapture)})});yn.displayName=pp;var gp="DismissableLayerBranch",bp=E.forwardRef((e,t)=>{const r=E.useContext(na),n=E.useRef(null),o=Oe(t,n);return E.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),h.jsx(Te.div,{...e,ref:o})});bp.displayName=gp;function vp(e,t=globalThis==null?void 0:globalThis.document){const r=Ot(e),n=E.useRef(!1),o=E.useRef(()=>{});return E.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){ia(hp,r,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function xp(e,t=globalThis==null?void 0:globalThis.document){const r=Ot(e),n=E.useRef(!1);return E.useEffect(()=>{const o=i=>{i.target&&!n.current&&ia(mp,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function oa(){const e=new CustomEvent(jo);document.dispatchEvent(e)}function ia(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?up(o,i):o.dispatchEvent(i)}var Ao=0;function sa(){E.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??aa()),document.body.insertAdjacentElement("beforeend",e[1]??aa()),Ao++,()=>{Ao===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ao--}},[])}function aa(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var To="focusScope.autoFocusOnMount",Oo="focusScope.autoFocusOnUnmount",la={bubbles:!1,cancelable:!0},wp="FocusScope",Io=E.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=E.useState(null),c=Ot(o),d=Ot(i),f=E.useRef(null),m=Oe(t,u=>l(u)),p=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(n){let u=function(k){if(p.paused||!a)return;const _=k.target;a.contains(_)?f.current=_:wt(f.current,{select:!0})},g=function(k){if(p.paused||!a)return;const _=k.relatedTarget;_!==null&&(a.contains(_)||wt(f.current,{select:!0}))},b=function(k){if(document.activeElement===document.body)for(const S of k)S.removedNodes.length>0&&wt(a)};document.addEventListener("focusin",u),document.addEventListener("focusout",g);const v=new MutationObserver(b);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",g),v.disconnect()}}},[n,a,p.paused]),E.useEffect(()=>{if(a){ua.add(p);const u=document.activeElement;if(!a.contains(u)){const b=new CustomEvent(To,la);a.addEventListener(To,c),a.dispatchEvent(b),b.defaultPrevented||(yp(Ep(ca(a)),{select:!0}),document.activeElement===u&&wt(a))}return()=>{a.removeEventListener(To,c),setTimeout(()=>{const b=new CustomEvent(Oo,la);a.addEventListener(Oo,d),a.dispatchEvent(b),b.defaultPrevented||wt(u??document.body,{select:!0}),a.removeEventListener(Oo,d),ua.remove(p)},0)}}},[a,c,d,p]);const w=E.useCallback(u=>{if(!r&&!n||p.paused)return;const g=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,b=document.activeElement;if(g&&b){const v=u.currentTarget,[k,_]=kp(v);k&&_?!u.shiftKey&&b===_?(u.preventDefault(),r&&wt(k,{select:!0})):u.shiftKey&&b===k&&(u.preventDefault(),r&&wt(_,{select:!0})):b===v&&u.preventDefault()}},[r,n,p.paused]);return h.jsx(Te.div,{tabIndex:-1,...s,ref:m,onKeyDown:w})});Io.displayName=wp;function yp(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(wt(n,{select:t}),document.activeElement!==r)return}function kp(e){const t=ca(e),r=da(t,e),n=da(t.reverse(),e);return[r,n]}function ca(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function da(e,t){for(const r of e)if(!_p(r,{upTo:t}))return r}function _p(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Sp(e){return e instanceof HTMLInputElement&&"select"in e}function wt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Sp(e)&&t&&e.select()}}var ua=Cp();function Cp(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=fa(e,t),e.unshift(t)},remove(t){var r;e=fa(e,t),(r=e[0])==null||r.resume()}}}function fa(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Ep(e){return e.filter(t=>t.tagName!=="A")}var Ue=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},Np=E[" useId ".trim().toString()]||(()=>{}),zp=0;function zr(e){const[t,r]=E.useState(Np());return Ue(()=>{r(n=>n??String(zp++))},[e]),t?`radix-${t}`:""}const jp=["top","right","bottom","left"],yt=Math.min,He=Math.max,kn=Math.round,_n=Math.floor,nt=e=>({x:e,y:e}),Ap={left:"right",right:"left",bottom:"top",top:"bottom"},Tp={start:"end",end:"start"};function Po(e,t,r){return He(e,yt(t,r))}function ut(e,t){return typeof e=="function"?e(t):e}function ft(e){return e.split("-")[0]}function Gt(e){return e.split("-")[1]}function Do(e){return e==="x"?"y":"x"}function Ro(e){return e==="y"?"height":"width"}const Op=new Set(["top","bottom"]);function ot(e){return Op.has(ft(e))?"y":"x"}function Mo(e){return Do(ot(e))}function Ip(e,t,r){r===void 0&&(r=!1);const n=Gt(e),o=Mo(e),i=Ro(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Sn(s)),[s,Sn(s)]}function Pp(e){const t=Sn(e);return[Lo(e),t,Lo(t)]}function Lo(e){return e.replace(/start|end/g,t=>Tp[t])}const pa=["left","right"],ha=["right","left"],Dp=["top","bottom"],Rp=["bottom","top"];function Mp(e,t,r){switch(e){case"top":case"bottom":return r?t?ha:pa:t?pa:ha;case"left":case"right":return t?Dp:Rp;default:return[]}}function Lp(e,t,r,n){const o=Gt(e);let i=Mp(ft(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Lo)))),i}function Sn(e){return e.replace(/left|right|bottom|top/g,t=>Ap[t])}function Fp(e){return{top:0,right:0,bottom:0,left:0,...e}}function ma(e){return typeof e!="number"?Fp(e):{top:e,right:e,bottom:e,left:e}}function Cn(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function ga(e,t,r){let{reference:n,floating:o}=e;const i=ot(t),s=Mo(t),a=Ro(s),l=ft(t),c=i==="y",d=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,m=n[a]/2-o[a]/2;let p;switch(l){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-o.width,y:f};break;default:p={x:n.x,y:n.y}}switch(Gt(t)){case"start":p[s]-=m*(r&&c?-1:1);break;case"end":p[s]+=m*(r&&c?-1:1);break}return p}async function Bp(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:m=!1,padding:p=0}=ut(t,e),w=ma(p),g=a[m?f==="floating"?"reference":"floating":f],b=Cn(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(g)))==null||r?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),v=f==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},S=Cn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:k,strategy:l}):v);return{top:(b.top-S.top+w.top)/_.y,bottom:(S.bottom-b.bottom+w.bottom)/_.y,left:(b.left-S.left+w.left)/_.x,right:(S.right-b.right+w.right)/_.x}}const Up=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=ga(c,n,l),m=n,p={},w=0;for(let g=0;g<a.length;g++){var u;const{name:b,fn:v}=a[g],{x:k,y:_,data:S,reset:O}=await v({x:d,y:f,initialPlacement:n,placement:m,strategy:o,middlewareData:p,rects:c,platform:{...s,detectOverflow:(u=s.detectOverflow)!=null?u:Bp},elements:{reference:e,floating:t}});d=k??d,f=_??f,p={...p,[b]:{...p[b],...S}},O&&w<=50&&(w++,typeof O=="object"&&(O.placement&&(m=O.placement),O.rects&&(c=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:d,y:f}=ga(c,m,l)),g=-1)}return{x:d,y:f,placement:m,strategy:o,middlewareData:p}},$p=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=ut(e,t)||{};if(c==null)return{};const f=ma(d),m={x:r,y:n},p=Mo(o),w=Ro(p),u=await s.getDimensions(c),g=p==="y",b=g?"top":"left",v=g?"bottom":"right",k=g?"clientHeight":"clientWidth",_=i.reference[w]+i.reference[p]-m[p]-i.floating[w],S=m[p]-i.reference[p],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let z=O?O[k]:0;(!z||!await(s.isElement==null?void 0:s.isElement(O)))&&(z=a.floating[k]||i.floating[w]);const I=_/2-S/2,D=z/2-u[w]/2-1,U=yt(f[b],D),H=yt(f[v],D),C=U,M=z-u[w]-H,y=z/2-u[w]/2+I,L=Po(C,y,M),Q=!l.arrow&&Gt(o)!=null&&y!==L&&i.reference[w]/2-(y<C?U:H)-u[w]/2<0,F=Q?y<C?y-C:y-M:0;return{[p]:m[p]+F,data:{[p]:L,centerOffset:y-L-F,...Q&&{alignmentOffset:F}},reset:Q}}}),Wp=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:u=!0,...g}=ut(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const b=ft(o),v=ot(a),k=ft(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=m||(k||!u?[Sn(a)]:Pp(a)),O=w!=="none";!m&&O&&S.push(...Lp(a,u,w,_));const z=[a,...S],I=await l.detectOverflow(t,g),D=[];let U=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&D.push(I[b]),f){const y=Ip(o,s,_);D.push(I[y[0]],I[y[1]])}if(U=[...U,{placement:o,overflows:D}],!D.every(y=>y<=0)){var H,C;const y=(((H=i.flip)==null?void 0:H.index)||0)+1,L=z[y];if(L&&(!(f==="alignment"?v!==ot(L):!1)||U.every($=>ot($.placement)===v?$.overflows[0]>0:!0)))return{data:{index:y,overflows:U},reset:{placement:L}};let Q=(C=U.filter(F=>F.overflows[0]<=0).sort((F,$)=>F.overflows[1]-$.overflows[1])[0])==null?void 0:C.placement;if(!Q)switch(p){case"bestFit":{var M;const F=(M=U.filter($=>{if(O){const V=ot($.placement);return V===v||V==="y"}return!0}).map($=>[$.placement,$.overflows.filter(V=>V>0).reduce((V,re)=>V+re,0)]).sort(($,V)=>$[1]-V[1])[0])==null?void 0:M[0];F&&(Q=F);break}case"initialPlacement":Q=a;break}if(o!==Q)return{reset:{placement:Q}}}return{}}}};function ba(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function va(e){return jp.some(t=>e[t]>=0)}const Hp=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=ut(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=ba(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:va(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=ba(s,r.floating);return{data:{escapedOffsets:a,escaped:va(a)}}}default:return{}}}}},xa=new Set(["left","top"]);async function Vp(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=ft(r),a=Gt(r),l=ot(r)==="y",c=xa.has(s)?-1:1,d=i&&l?-1:1,f=ut(t,e);let{mainAxis:m,crossAxis:p,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof w=="number"&&(p=a==="end"?w*-1:w),l?{x:p*d,y:m*c}:{x:m*c,y:p*d}}const Zp=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Vp(t,e);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Gp=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:v,y:k}=b;return{x:v,y:k}}},...c}=ut(e,t),d={x:r,y:n},f=await i.detectOverflow(t,c),m=ot(ft(o)),p=Do(m);let w=d[p],u=d[m];if(s){const b=p==="y"?"top":"left",v=p==="y"?"bottom":"right",k=w+f[b],_=w-f[v];w=Po(k,w,_)}if(a){const b=m==="y"?"top":"left",v=m==="y"?"bottom":"right",k=u+f[b],_=u-f[v];u=Po(k,u,_)}const g=l.fn({...t,[p]:w,[m]:u});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[p]:s,[m]:a}}}}}},Kp=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=ut(e,t),d={x:r,y:n},f=ot(o),m=Do(f);let p=d[m],w=d[f];const u=ut(a,t),g=typeof u=="number"?{mainAxis:u,crossAxis:0}:{mainAxis:0,crossAxis:0,...u};if(l){const k=m==="y"?"height":"width",_=i.reference[m]-i.floating[k]+g.mainAxis,S=i.reference[m]+i.reference[k]-g.mainAxis;p<_?p=_:p>S&&(p=S)}if(c){var b,v;const k=m==="y"?"width":"height",_=xa.has(ft(o)),S=i.reference[f]-i.floating[k]+(_&&((b=s.offset)==null?void 0:b[f])||0)+(_?0:g.crossAxis),O=i.reference[f]+i.reference[k]+(_?0:((v=s.offset)==null?void 0:v[f])||0)-(_?g.crossAxis:0);w<S?w=S:w>O&&(w=O)}return{[m]:p,[f]:w}}}},Yp=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=ut(e,t),d=await s.detectOverflow(t,c),f=ft(o),m=Gt(o),p=ot(o)==="y",{width:w,height:u}=i.floating;let g,b;f==="top"||f==="bottom"?(g=f,b=m===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(b=f,g=m==="end"?"top":"bottom");const v=u-d.top-d.bottom,k=w-d.left-d.right,_=yt(u-d[g],v),S=yt(w-d[b],k),O=!t.middlewareData.shift;let z=_,I=S;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(I=k),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(z=v),O&&!m){const U=He(d.left,0),H=He(d.right,0),C=He(d.top,0),M=He(d.bottom,0);p?I=w-2*(U!==0||H!==0?U+H:He(d.left,d.right)):z=u-2*(C!==0||M!==0?C+M:He(d.top,d.bottom))}await l({...t,availableWidth:I,availableHeight:z});const D=await s.getDimensions(a.floating);return w!==D.width||u!==D.height?{reset:{rects:!0}}:{}}}};function En(){return typeof window<"u"}function Kt(e){return wa(e)?(e.nodeName||"").toLowerCase():"#document"}function Ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function it(e){var t;return(t=(wa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wa(e){return En()?e instanceof Node||e instanceof Ve(e).Node:!1}function et(e){return En()?e instanceof Element||e instanceof Ve(e).Element:!1}function st(e){return En()?e instanceof HTMLElement||e instanceof Ve(e).HTMLElement:!1}function ya(e){return!En()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ve(e).ShadowRoot}const qp=new Set(["inline","contents"]);function jr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=tt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!qp.has(o)}const Xp=new Set(["table","td","th"]);function Jp(e){return Xp.has(Kt(e))}const Qp=[":popover-open",":modal"];function Nn(e){return Qp.some(t=>{try{return e.matches(t)}catch{return!1}})}const eh=["transform","translate","scale","rotate","perspective"],th=["transform","translate","scale","rotate","perspective","filter"],rh=["paint","layout","strict","content"];function Fo(e){const t=Bo(),r=et(e)?tt(e):e;return eh.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||th.some(n=>(r.willChange||"").includes(n))||rh.some(n=>(r.contain||"").includes(n))}function nh(e){let t=kt(e);for(;st(t)&&!Yt(t);){if(Fo(t))return t;if(Nn(t))return null;t=kt(t)}return null}function Bo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const oh=new Set(["html","body","#document"]);function Yt(e){return oh.has(Kt(e))}function tt(e){return Ve(e).getComputedStyle(e)}function zn(e){return et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kt(e){if(Kt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ya(e)&&e.host||it(e);return ya(t)?t.host:t}function ka(e){const t=kt(e);return Yt(t)?e.ownerDocument?e.ownerDocument.body:e.body:st(t)&&jr(t)?t:ka(t)}function Ar(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=ka(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=Ve(o);if(i){const a=Uo(s);return t.concat(s,s.visualViewport||[],jr(o)?o:[],a&&r?Ar(a):[])}return t.concat(o,Ar(o,[],r))}function Uo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _a(e){const t=tt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=st(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=kn(r)!==i||kn(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function $o(e){return et(e)?e:e.contextElement}function qt(e){const t=$o(e);if(!st(t))return nt(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=_a(t);let s=(i?kn(r.width):r.width)/n,a=(i?kn(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ih=nt(0);function Sa(e){const t=Ve(e);return!Bo()||!t.visualViewport?ih:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ve(e)?!1:t}function It(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=$o(e);let s=nt(1);t&&(n?et(n)&&(s=qt(n)):s=qt(e));const a=sh(i,r,n)?Sa(i):nt(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,f=o.height/s.y;if(i){const m=Ve(i),p=n&&et(n)?Ve(n):n;let w=m,u=Uo(w);for(;u&&n&&p!==w;){const g=qt(u),b=u.getBoundingClientRect(),v=tt(u),k=b.left+(u.clientLeft+parseFloat(v.paddingLeft))*g.x,_=b.top+(u.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,c*=g.y,d*=g.x,f*=g.y,l+=k,c+=_,w=Ve(u),u=Uo(w)}}return Cn({width:d,height:f,x:l,y:c})}function jn(e,t){const r=zn(e).scrollLeft;return t?t.left+r:It(it(e)).left+r}function Ca(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-jn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function ah(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=it(n),a=t?Nn(t.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},c=nt(1);const d=nt(0),f=st(n);if((f||!f&&!i)&&((Kt(n)!=="body"||jr(s))&&(l=zn(n)),st(n))){const p=It(n);c=qt(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const m=s&&!f&&!i?Ca(s,l):nt(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+m.x,y:r.y*c.y-l.scrollTop*c.y+d.y+m.y}}function lh(e){return Array.from(e.getClientRects())}function ch(e){const t=it(e),r=zn(e),n=e.ownerDocument.body,o=He(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=He(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+jn(e);const a=-r.scrollTop;return tt(n).direction==="rtl"&&(s+=He(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Ea=25;function dh(e,t){const r=Ve(e),n=it(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const d=Bo();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=jn(n);if(c<=0){const d=n.ownerDocument,f=d.body,m=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,w=Math.abs(n.clientWidth-f.clientWidth-p);w<=Ea&&(i-=w)}else c<=Ea&&(i+=c);return{width:i,height:s,x:a,y:l}}const uh=new Set(["absolute","fixed"]);function fh(e,t){const r=It(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=st(e)?qt(e):nt(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=n*i.y;return{width:s,height:a,x:l,y:c}}function Na(e,t,r){let n;if(t==="viewport")n=dh(e,r);else if(t==="document")n=ch(it(e));else if(et(t))n=fh(t,r);else{const o=Sa(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Cn(n)}function za(e,t){const r=kt(e);return r===t||!et(r)||Yt(r)?!1:tt(r).position==="fixed"||za(r,t)}function ph(e,t){const r=t.get(e);if(r)return r;let n=Ar(e,[],!1).filter(a=>et(a)&&Kt(a)!=="body"),o=null;const i=tt(e).position==="fixed";let s=i?kt(e):e;for(;et(s)&&!Yt(s);){const a=tt(s),l=Fo(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&uh.has(o.position)||jr(s)&&!l&&za(e,s))?n=n.filter(d=>d!==s):o=a,s=kt(s)}return t.set(e,n),n}function hh(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?Nn(t)?[]:ph(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((c,d)=>{const f=Na(t,d,o);return c.top=He(f.top,c.top),c.right=yt(f.right,c.right),c.bottom=yt(f.bottom,c.bottom),c.left=He(f.left,c.left),c},Na(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function mh(e){const{width:t,height:r}=_a(e);return{width:t,height:r}}function gh(e,t,r){const n=st(t),o=it(t),i=r==="fixed",s=It(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=nt(0);function c(){l.x=jn(o)}if(n||!n&&!i)if((Kt(t)!=="body"||jr(o))&&(a=zn(t)),n){const p=It(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();i&&!n&&o&&c();const d=o&&!n&&!i?Ca(o,a):nt(0),f=s.left+a.scrollLeft-l.x-d.x,m=s.top+a.scrollTop-l.y-d.y;return{x:f,y:m,width:s.width,height:s.height}}function Wo(e){return tt(e).position==="static"}function ja(e,t){if(!st(e)||tt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return it(e)===r&&(r=r.ownerDocument.body),r}function Aa(e,t){const r=Ve(e);if(Nn(e))return r;if(!st(e)){let o=kt(e);for(;o&&!Yt(o);){if(et(o)&&!Wo(o))return o;o=kt(o)}return r}let n=ja(e,t);for(;n&&Jp(n)&&Wo(n);)n=ja(n,t);return n&&Yt(n)&&Wo(n)&&!Fo(n)?r:n||nh(e)||r}const bh=async function(e){const t=this.getOffsetParent||Aa,r=this.getDimensions,n=await r(e.floating);return{reference:gh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function vh(e){return tt(e).direction==="rtl"}const xh={convertOffsetParentRelativeRectToViewportRelativeRect:ah,getDocumentElement:it,getClippingRect:hh,getOffsetParent:Aa,getElementRects:bh,getClientRects:lh,getDimensions:mh,getScale:qt,isElement:et,isRTL:vh};function Ta(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wh(e,t){let r=null,n;const o=it(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:f,width:m,height:p}=c;if(a||t(),!m||!p)return;const w=_n(f),u=_n(o.clientWidth-(d+m)),g=_n(o.clientHeight-(f+p)),b=_n(d),k={rootMargin:-w+"px "+-u+"px "+-g+"px "+-b+"px",threshold:He(0,yt(1,l))||1};let _=!0;function S(O){const z=O[0].intersectionRatio;if(z!==l){if(!_)return s();z?s(!1,z):n=setTimeout(()=>{s(!1,1e-7)},1e3)}z===1&&!Ta(c,e.getBoundingClientRect())&&s(),_=!1}try{r=new IntersectionObserver(S,{...k,root:o.ownerDocument})}catch{r=new IntersectionObserver(S,k)}r.observe(e)}return s(!0),i}function yh(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=$o(e),d=o||i?[...c?Ar(c):[],...Ar(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),i&&b.addEventListener("resize",r)});const f=c&&a?wh(c,r):null;let m=-1,p=null;s&&(p=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var k;(k=p)==null||k.observe(t)})),r()}),c&&!l&&p.observe(c),p.observe(t));let w,u=l?It(e):null;l&&g();function g(){const b=It(e);u&&!Ta(u,b)&&r(),u=b,w=requestAnimationFrame(g)}return r(),()=>{var b;d.forEach(v=>{o&&v.removeEventListener("scroll",r),i&&v.removeEventListener("resize",r)}),f==null||f(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(w)}}const kh=Zp,_h=Gp,Sh=Wp,Ch=Yp,Eh=Hp,Oa=$p,Nh=Kp,zh=(e,t,r)=>{const n=new Map,o={platform:xh,...r},i={...o.platform,_c:n};return Up(e,t,{...o,platform:i})};var jh=typeof document<"u",Ah=function(){},An=jh?N.useLayoutEffect:Ah;function Tn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Tn(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!Tn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ia(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pa(e,t){const r=Ia(e);return Math.round(t*r)/r}function Ho(e){const t=E.useRef(e);return An(()=>{t.current=e}),t}function Th(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,f]=E.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=E.useState(n);Tn(m,n)||p(n);const[w,u]=E.useState(null),[g,b]=E.useState(null),v=E.useCallback($=>{$!==O.current&&(O.current=$,u($))},[]),k=E.useCallback($=>{$!==z.current&&(z.current=$,b($))},[]),_=i||w,S=s||g,O=E.useRef(null),z=E.useRef(null),I=E.useRef(d),D=l!=null,U=Ho(l),H=Ho(o),C=Ho(c),M=E.useCallback(()=>{if(!O.current||!z.current)return;const $={placement:t,strategy:r,middleware:m};H.current&&($.platform=H.current),zh(O.current,z.current,$).then(V=>{const re={...V,isPositioned:C.current!==!1};y.current&&!Tn(I.current,re)&&(I.current=re,Wr.flushSync(()=>{f(re)}))})},[m,t,r,H,C]);An(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,f($=>({...$,isPositioned:!1})))},[c]);const y=E.useRef(!1);An(()=>(y.current=!0,()=>{y.current=!1}),[]),An(()=>{if(_&&(O.current=_),S&&(z.current=S),_&&S){if(U.current)return U.current(_,S,M);M()}},[_,S,M,U,D]);const L=E.useMemo(()=>({reference:O,floating:z,setReference:v,setFloating:k}),[v,k]),Q=E.useMemo(()=>({reference:_,floating:S}),[_,S]),F=E.useMemo(()=>{const $={position:r,left:0,top:0};if(!Q.floating)return $;const V=Pa(Q.floating,d.x),re=Pa(Q.floating,d.y);return a?{...$,transform:"translate("+V+"px, "+re+"px)",...Ia(Q.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:V,top:re}},[r,a,Q.floating,d.x,d.y]);return E.useMemo(()=>({...d,update:M,refs:L,elements:Q,floatingStyles:F}),[d,M,L,Q,F])}const Oh=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Oa({element:n.current,padding:o}).fn(r):{}:n?Oa({element:n,padding:o}).fn(r):{}}}},Ih=(e,t)=>({...kh(e),options:[e,t]}),Ph=(e,t)=>({..._h(e),options:[e,t]}),Dh=(e,t)=>({...Nh(e),options:[e,t]}),Rh=(e,t)=>({...Sh(e),options:[e,t]}),Mh=(e,t)=>({...Ch(e),options:[e,t]}),Lh=(e,t)=>({...Eh(e),options:[e,t]}),Fh=(e,t)=>({...Oh(e),options:[e,t]});var Bh="Arrow",Da=E.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return h.jsx(Te.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});Da.displayName=Bh;var Uh=Da;function $h(e){const[t,r]=E.useState(void 0);return Ue(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;r({width:s,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Vo="Popper",[Ra,Xt]=Nr(Vo),[Wh,Ma]=Ra(Vo),La=e=>{const{__scopePopper:t,children:r}=e,[n,o]=E.useState(null);return h.jsx(Wh,{scope:t,anchor:n,onAnchorChange:o,children:r})};La.displayName=Vo;var Fa="PopperAnchor",Ba=E.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=Ma(Fa,r),s=E.useRef(null),a=Oe(t,s),l=E.useRef(null);return E.useEffect(()=>{const c=l.current;l.current=(n==null?void 0:n.current)||s.current,c!==l.current&&i.onAnchorChange(l.current)}),n?null:h.jsx(Te.div,{...o,ref:a})});Ba.displayName=Fa;var Zo="PopperContent",[Hh,Vh]=Ra(Zo),Ua=E.forwardRef((e,t)=>{var q,ie,ue,ae,pe,ve;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:p="optimized",onPlaced:w,...u}=e,g=Ma(Zo,r),[b,v]=E.useState(null),k=Oe(t,_e=>v(_e)),[_,S]=E.useState(null),O=$h(_),z=(O==null?void 0:O.width)??0,I=(O==null?void 0:O.height)??0,D=n+(i!=="center"?"-"+i:""),U=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},H=Array.isArray(c)?c:[c],C=H.length>0,M={padding:U,boundary:H.filter(Gh),altBoundary:C},{refs:y,floatingStyles:L,placement:Q,isPositioned:F,middlewareData:$}=Th({strategy:"fixed",placement:D,whileElementsMounted:(..._e)=>yh(..._e,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[Ih({mainAxis:o+I,alignmentAxis:s}),l&&Ph({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Dh():void 0,...M}),l&&Rh({...M}),Mh({...M,apply:({elements:_e,rects:x,availableWidth:K,availableHeight:W})=>{const{width:T,height:j}=x.reference,R=_e.floating.style;R.setProperty("--radix-popper-available-width",`${K}px`),R.setProperty("--radix-popper-available-height",`${W}px`),R.setProperty("--radix-popper-anchor-width",`${T}px`),R.setProperty("--radix-popper-anchor-height",`${j}px`)}}),_&&Fh({element:_,padding:a}),Kh({arrowWidth:z,arrowHeight:I}),m&&Lh({strategy:"referenceHidden",...M})]}),[V,re]=Ha(Q),A=Ot(w);Ue(()=>{F&&(A==null||A())},[F,A]);const P=(q=$.arrow)==null?void 0:q.x,J=(ie=$.arrow)==null?void 0:ie.y,G=((ue=$.arrow)==null?void 0:ue.centerOffset)!==0,[te,ce]=E.useState();return Ue(()=>{b&&ce(window.getComputedStyle(b).zIndex)},[b]),h.jsx("div",{ref:y.setFloating,"data-radix-popper-content-wrapper":"",style:{...L,transform:F?L.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[(ae=$.transformOrigin)==null?void 0:ae.x,(pe=$.transformOrigin)==null?void 0:pe.y].join(" "),...((ve=$.hide)==null?void 0:ve.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(Hh,{scope:r,placedSide:V,onArrowChange:S,arrowX:P,arrowY:J,shouldHideArrow:G,children:h.jsx(Te.div,{"data-side":V,"data-align":re,...u,ref:k,style:{...u.style,animation:F?void 0:"none"}})})})});Ua.displayName=Zo;var $a="PopperArrow",Zh={top:"bottom",right:"left",bottom:"top",left:"right"},Wa=E.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Vh($a,n),s=Zh[i.placedSide];return h.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:h.jsx(Uh,{...o,ref:r,style:{...o.style,display:"block"}})})});Wa.displayName=$a;function Gh(e){return e!==null}var Kh=e=>({name:"transformOrigin",options:e,fn(t){var g,b,v;const{placement:r,rects:n,middlewareData:o}=t,s=((g=o.arrow)==null?void 0:g.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,d]=Ha(r),f={start:"0%",center:"50%",end:"100%"}[d],m=(((b=o.arrow)==null?void 0:b.x)??0)+a/2,p=(((v=o.arrow)==null?void 0:v.y)??0)+l/2;let w="",u="";return c==="bottom"?(w=s?f:`${m}px`,u=`${-l}px`):c==="top"?(w=s?f:`${m}px`,u=`${n.floating.height+l}px`):c==="right"?(w=`${-l}px`,u=s?f:`${p}px`):c==="left"&&(w=`${n.floating.width+l}px`,u=s?f:`${p}px`),{data:{x:w,y:u}}}});function Ha(e){const[t,r="center"]=e.split("-");return[t,r]}var Go=La,On=Ba,Ko=Ua,Yo=Wa,Yh="Portal",In=E.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,i]=E.useState(!1);Ue(()=>i(!0),[]);const s=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?mt.createPortal(h.jsx(Te.div,{...n,ref:t}),s):null});In.displayName=Yh;var qh=E[" useInsertionEffect ".trim().toString()]||Ue;function Pn({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Xh({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const d=E.useRef(e!==void 0);E.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,n])}const c=E.useCallback(d=>{var f;if(a){const m=Jh(d)?d(e):d;m!==e&&((f=s.current)==null||f.call(s,m))}else i(d)},[a,e,i,s]);return[l,c]}function Xh({defaultProp:e,onChange:t}){const[r,n]=E.useState(e),o=E.useRef(r),i=E.useRef(t);return qh(()=>{i.current=t},[t]),E.useEffect(()=>{var s;o.current!==r&&((s=i.current)==null||s.call(i,r),o.current=r)},[r,o]),[r,n,i]}function Jh(e){return typeof e=="function"}function Qh(e){const t=E.useRef({value:e,previous:e});return E.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Va=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),em="VisuallyHidden",Za=E.forwardRef((e,t)=>h.jsx(Te.span,{...e,ref:t,style:{...Va,...e.style}}));Za.displayName=em;var tm=Za,rm=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jt=new WeakMap,Dn=new WeakMap,Rn={},qo=0,Ga=function(e){return e&&(e.host||Ga(e.parentNode))},nm=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Ga(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},om=function(e,t,r,n){var o=nm(t,Array.isArray(e)?e:[e]);Rn[r]||(Rn[r]=new WeakMap);var i=Rn[r],s=[],a=new Set,l=new Set(o),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};o.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(m){if(a.has(m))d(m);else try{var p=m.getAttribute(n),w=p!==null&&p!=="false",u=(Jt.get(m)||0)+1,g=(i.get(m)||0)+1;Jt.set(m,u),i.set(m,g),s.push(m),u===1&&w&&Dn.set(m,!0),g===1&&m.setAttribute(r,"true"),w||m.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",m,b)}})};return d(t),a.clear(),qo++,function(){s.forEach(function(f){var m=Jt.get(f)-1,p=i.get(f)-1;Jt.set(f,m),i.set(f,p),m||(Dn.has(f)||f.removeAttribute(n),Dn.delete(f)),p||f.removeAttribute(r)}),qo--,qo||(Jt=new WeakMap,Jt=new WeakMap,Dn=new WeakMap,Rn={})}},Ka=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=rm(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),om(n,o,r,"aria-hidden")):function(){return null}},at=function(){return at=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},at.apply(this,arguments)};function Ya(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function im(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Mn="right-scroll-bar-position",Ln="width-before-scroll-bar",sm="with-scroll-bars-hidden",am="--removed-body-scroll-bar-size";function Xo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function lm(e,t){var r=N.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var cm=typeof window<"u"?E.useLayoutEffect:E.useEffect,qa=new WeakMap;function dm(e,t){var r=lm(null,function(n){return e.forEach(function(o){return Xo(o,n)})});return cm(function(){var n=qa.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(a){i.has(a)||Xo(a,null)}),i.forEach(function(a){o.has(a)||Xo(a,s)})}qa.set(r,e)},[e]),r}function um(e){return e}function fm(e,t){t===void 0&&(t=um);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(i),s=r}var l=function(){var d=s;s=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(d){s.push(d),c()},filter:function(d){return s=s.filter(d),r}}}};return o}function pm(e){e===void 0&&(e={});var t=fm(null);return t.options=at({async:!0,ssr:!1},e),t}var Xa=function(e){var t=e.sideCar,r=Ya(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return E.createElement(n,at({},r))};Xa.isSideCarExport=!0;function hm(e,t){return e.useMedium(t),Xa}var Ja=pm(),Jo=function(){},Fn=E.forwardRef(function(e,t){var r=E.useRef(null),n=E.useState({onScrollCapture:Jo,onWheelCapture:Jo,onTouchMoveCapture:Jo}),o=n[0],i=n[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,m=e.sideCar,p=e.noRelative,w=e.noIsolation,u=e.inert,g=e.allowPinchZoom,b=e.as,v=b===void 0?"div":b,k=e.gapMode,_=Ya(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,O=dm([r,t]),z=at(at({},_),o);return E.createElement(E.Fragment,null,d&&E.createElement(S,{sideCar:Ja,removeScrollBar:c,shards:f,noRelative:p,noIsolation:w,inert:u,setCallbacks:i,allowPinchZoom:!!g,lockRef:r,gapMode:k}),s?E.cloneElement(E.Children.only(a),at(at({},z),{ref:O})):E.createElement(v,at({},z,{className:l,ref:O}),a))});Fn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Fn.classNames={fullWidth:Ln,zeroRight:Mn};var mm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=mm();return t&&e.setAttribute("nonce",t),e}function bm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var xm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=gm())&&(bm(t,r),vm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},wm=function(){var e=xm();return function(t,r){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Qa=function(){var e=wm(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},ym={left:0,top:0,right:0,gap:0},Qo=function(e){return parseInt(e||"",10)||0},km=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Qo(r),Qo(n),Qo(o)]},_m=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ym;var t=km(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Sm=Qa(),Qt="data-scroll-locked",Cm=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,a=e.gap;return r===void 0&&(r="margin"),`
213
- .`.concat(sm,` {
186
+ `},pu={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function hu(e){let{announcements:t=pu,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=fu}=e;const{announce:i,announcement:s}=cu(),a=yr("DndLiveRegion"),[l,d]=b.useState(!1);if(b.useEffect(()=>{d(!0)},[]),du(b.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&i(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;i(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;i(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;i(t.onDragCancel({active:h,over:p}))}}),[i,t])),!l)return null;const u=b.createElement(b.Fragment,null,b.createElement(au,{id:n,value:o.draggable}),b.createElement(lu,{id:a,announcement:s}));return r?bt.createPortal(u,r):u}var Te;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Te||(Te={}));function fn(){}function mo(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function mu(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return b.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const et=Object.freeze({x:0,y:0});function us(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function gu(e,t){const r=un(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function fs(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function bu(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function ps(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function hs(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function ms(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const vu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ms(t,t.left,t.top),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const d=us(ms(l),o);i.push({id:a,data:{droppableContainer:s,value:d}})}}return i.sort(fs)},xu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=ps(t),i=[];for(const s of n){const{id:a}=s,l=r.get(a);if(l){const d=ps(l),u=o.reduce((h,p,w)=>h+us(d[w],p),0),f=Number((u/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:f}})}}return i.sort(fs)};function wu(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-n,a=i-r;if(n<o&&r<i){const l=t.width*t.height,d=e.width*e.height,u=s*a,f=u/(l+d-u);return Number(f.toFixed(4))}return 0}const yu=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const i of n){const{id:s}=i,a=r.get(s);if(a){const l=wu(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(bu)};function ku(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function gs(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:et}function Su(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...r})}}const Cu=Su(1);function bs(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Eu(e,t,r){const n=bs(t);if(!n)return e;const{scaleX:o,scaleY:i,x:s,y:a}=n,l=e.left-s-(1-o)*parseFloat(r),d=e.top-a-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),u=o?e.width/o:e.width,f=i?e.height/i:e.height;return{width:u,height:f,top:d,right:l+u,bottom:d+f,left:l}}const Nu={ignoreTransform:!1};function Gt(e,t){t===void 0&&(t=Nu);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:u}=Fe(e).getComputedStyle(e);d&&(r=Eu(r,d,u))}const{top:n,left:o,width:i,height:s,bottom:a,right:l}=r;return{top:n,left:o,width:i,height:s,bottom:a,right:l}}function vs(e){return Gt(e,{ignoreTransform:!0})}function ju(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Au(e,t){return t===void 0&&(t=Fe(e).getComputedStyle(e)),t.position==="fixed"}function Tu(e,t){t===void 0&&(t=Fe(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?r.test(i):!1})}function pn(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(po(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!vr(o)||as(o)||r.includes(o))return r;const i=Fe(e).getComputedStyle(o);return o!==e&&Tu(o,i)&&r.push(o),Au(o,i)?r:n(o.parentNode)}return e?n(e):r}function xs(e){const[t]=pn(e,1);return t??null}function go(e){return!sn||!e?null:Ht(e)?e:fo(e)?po(e)||e===Vt(e).scrollingElement?window:vr(e)?e:null:null}function ws(e){return Ht(e)?e.scrollX:e.scrollLeft}function ys(e){return Ht(e)?e.scrollY:e.scrollTop}function bo(e){return{x:ws(e),y:ys(e)}}var Pe;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Pe||(Pe={}));function ks(e){return!sn||!e?!1:e===document.scrollingElement}function Ss(e){const t={x:0,y:0},r=ks(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:n,minScroll:t}}const zu={x:.2,y:.2};function Pu(e,t,r,n,o){let{top:i,left:s,right:a,bottom:l}=r;n===void 0&&(n=10),o===void 0&&(o=zu);const{isTop:d,isBottom:u,isLeft:f,isRight:h}=Ss(e),p={x:0,y:0},w={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!d&&i<=t.top+m.height?(p.y=Pe.Backward,w.y=n*Math.abs((t.top+m.height-i)/m.height)):!u&&l>=t.bottom-m.height&&(p.y=Pe.Forward,w.y=n*Math.abs((t.bottom-m.height-l)/m.height)),!h&&a>=t.right-m.width?(p.x=Pe.Forward,w.x=n*Math.abs((t.right-m.width-a)/m.width)):!f&&s<=t.left+m.width&&(p.x=Pe.Backward,w.x=n*Math.abs((t.left+m.width-s)/m.width)),{direction:p,speed:w}}function Ou(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Cs(e){return e.reduce((t,r)=>Kt(t,bo(r)),et)}function Iu(e){return e.reduce((t,r)=>t+ws(r),0)}function Du(e){return e.reduce((t,r)=>t+ys(r),0)}function Es(e,t){if(t===void 0&&(t=Gt),!e)return;const{top:r,left:n,bottom:o,right:i}=t(e);xs(e)&&(o<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const _u=[["x",["left","right"],Iu],["y",["top","bottom"],Du]];class vo{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=pn(r),o=Cs(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of _u)for(const l of s)Object.defineProperty(this,l,{get:()=>{const d=a(n),u=o[i]-d;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Sr{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Mu(e){const{EventTarget:t}=Fe(e);return e instanceof t?e:Vt(e)}function xo(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Ze;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ze||(Ze={}));function Ns(e){e.preventDefault()}function Ru(e){e.stopPropagation()}var ue;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(ue||(ue={}));const js={start:[ue.Space,ue.Enter],cancel:[ue.Esc],end:[ue.Space,ue.Enter,ue.Tab]},Lu=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case ue.Right:return{...r,x:r.x+25};case ue.Left:return{...r,x:r.x-25};case ue.Down:return{...r,y:r.y+25};case ue.Up:return{...r,y:r.y-25}}};class wo{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Sr(Vt(r)),this.windowListeners=new Sr(Fe(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ze.Resize,this.handleCancel),this.windowListeners.add(Ze.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ze.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Es(n),r(et)}handleKeyDown(t){if(dn(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:i=js,coordinateGetter:s=Lu,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:d}=n.current,u=d?{x:d.left,y:d.top}:et;this.referenceCoordinates||(this.referenceCoordinates=u);const f=s(t,{active:r,context:n.current,currentCoordinates:u});if(f){const h=kr(f,u),p={x:0,y:0},{scrollableAncestors:w}=n.current;for(const m of w){const v=t.code,{isTop:y,isRight:k,isLeft:x,isBottom:S,maxScroll:C,minScroll:E}=Ss(m),j=Ou(m),N={x:Math.min(v===ue.Right?j.right-j.width/2:j.right,Math.max(v===ue.Right?j.left:j.left+j.width/2,f.x)),y:Math.min(v===ue.Down?j.bottom-j.height/2:j.bottom,Math.max(v===ue.Down?j.top:j.top+j.height/2,f.y))},_=v===ue.Right&&!k||v===ue.Left&&!x,R=v===ue.Down&&!S||v===ue.Up&&!y;if(_&&N.x!==f.x){const I=m.scrollLeft+h.x,L=v===ue.Right&&I<=C.x||v===ue.Left&&I>=E.x;if(L&&!h.y){m.scrollTo({left:I,behavior:a});return}L?p.x=m.scrollLeft-I:p.x=v===ue.Right?m.scrollLeft-C.x:m.scrollLeft-E.x,p.x&&m.scrollBy({left:-p.x,behavior:a});break}else if(R&&N.y!==f.y){const I=m.scrollTop+h.y,L=v===ue.Down&&I<=C.y||v===ue.Up&&I>=E.y;if(L&&!h.x){m.scrollTo({top:I,behavior:a});return}L?p.y=m.scrollTop-I:p.y=v===ue.Down?m.scrollTop-C.y:m.scrollTop-E.y,p.y&&m.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,Kt(kr(f,this.referenceCoordinates),p))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}wo.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=js,onActivation:o}=t,{active:i}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function As(e){return!!(e&&"distance"in e)}function Ts(e){return!!(e&&"delay"in e)}class yo{constructor(t,r,n){var o;n===void 0&&(n=Mu(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:s}=i;this.props=t,this.events=r,this.document=Vt(s),this.documentListeners=new Sr(this.document),this.listeners=new Sr(n),this.windowListeners=new Sr(Fe(s)),this.initialCoordinates=(o=un(i))!=null?o:et,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ze.Resize,this.handleCancel),this.windowListeners.add(Ze.DragStart,Ns),this.windowListeners.add(Ze.VisibilityChange,this.handleCancel),this.windowListeners.add(Ze.ContextMenu,Ns),this.documentListeners.add(Ze.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ts(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(As(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ze.Click,Ru,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ze.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(r=un(t))!=null?r:et,d=kr(o,l);if(!n&&a){if(As(a)){if(a.tolerance!=null&&xo(d,a.tolerance))return this.handleCancel();if(xo(d,a.distance))return this.handleStart()}if(Ts(a)&&xo(d,a.tolerance))return this.handleCancel();this.handlePending(a,d);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===ue.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const $u={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ko extends yo{constructor(t){const{event:r}=t,n=Vt(r.target);super(t,$u,n)}}ko.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Fu={move:{name:"mousemove"},end:{name:"mouseup"}};var So;(function(e){e[e.RightClick=2]="RightClick"})(So||(So={}));class Wu extends yo{constructor(t){super(t,Fu,Vt(t.event.target))}}Wu.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===So.RightClick?!1:(n==null||n({event:r}),!0)}}];const Co={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class zs extends yo{constructor(t){super(t,Co)}static setup(){return window.addEventListener(Co.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Co.move.name,t)};function t(){}}}zs.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n==null||n({event:r}),!0)}}];var Cr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Cr||(Cr={}));var hn;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(hn||(hn={}));function Uu(e){let{acceleration:t,activator:r=Cr.Pointer,canScroll:n,draggingRect:o,enabled:i,interval:s=5,order:a=hn.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:u,delta:f,threshold:h}=e;const p=Hu({delta:f,disabled:!i}),[w,m]=ru(),v=b.useRef({x:0,y:0}),y=b.useRef({x:0,y:0}),k=b.useMemo(()=>{switch(r){case Cr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Cr.DraggableRect:return o}},[r,o,l]),x=b.useRef(null),S=b.useCallback(()=>{const E=x.current;if(!E)return;const j=v.current.x*y.current.x,N=v.current.y*y.current.y;E.scrollBy(j,N)},[]),C=b.useMemo(()=>a===hn.TreeOrder?[...d].reverse():d,[a,d]);b.useEffect(()=>{if(!i||!d.length||!k){m();return}for(const E of C){if((n==null?void 0:n(E))===!1)continue;const j=d.indexOf(E),N=u[j];if(!N)continue;const{direction:_,speed:R}=Pu(E,N,k,t,h);for(const I of["x","y"])p[I][_[I]]||(R[I]=0,_[I]=0);if(R.x>0||R.y>0){m(),x.current=E,w(S,s),v.current=R,y.current=_;return}}v.current={x:0,y:0},y.current={x:0,y:0},m()},[t,S,n,m,i,s,JSON.stringify(k),JSON.stringify(p),w,d,C,u,JSON.stringify(h)])}const Bu={x:{[Pe.Backward]:!1,[Pe.Forward]:!1},y:{[Pe.Backward]:!1,[Pe.Forward]:!1}};function Hu(e){let{delta:t,disabled:r}=e;const n=cn(t);return wr(o=>{if(r||!n||!o)return Bu;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Pe.Backward]:o.x[Pe.Backward]||i.x===-1,[Pe.Forward]:o.x[Pe.Forward]||i.x===1},y:{[Pe.Backward]:o.y[Pe.Backward]||i.y===-1,[Pe.Forward]:o.y[Pe.Forward]||i.y===1}}},[r,t,n])}function Vu(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return wr(o=>{var i;return t==null?null:(i=n??o)!=null?i:null},[n,t])}function Ku(e,t){return b.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...i]},[]),[e,t])}var Er;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Er||(Er={}));var Eo;(function(e){e.Optimized="optimized"})(Eo||(Eo={}));const Ps=new Map;function Gu(e,t){let{dragging:r,dependencies:n,config:o}=t;const[i,s]=b.useState(null),{frequency:a,measure:l,strategy:d}=o,u=b.useRef(e),f=v(),h=xr(f),p=b.useCallback(function(y){y===void 0&&(y=[]),!h.current&&s(k=>k===null?y:k.concat(y.filter(x=>!k.includes(x))))},[h]),w=b.useRef(null),m=wr(y=>{if(f&&!r)return Ps;if(!y||y===Ps||u.current!==e||i!=null){const k=new Map;for(let x of e){if(!x)continue;if(i&&i.length>0&&!i.includes(x.id)&&x.rect.current){k.set(x.id,x.rect.current);continue}const S=x.node.current,C=S?new vo(l(S),S):null;x.rect.current=C,C&&k.set(x.id,C)}return k}return y},[e,i,r,f,l]);return b.useEffect(()=>{u.current=e},[e]),b.useEffect(()=>{f||p()},[r,f]),b.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),b.useEffect(()=>{f||typeof a!="number"||w.current!==null||(w.current=setTimeout(()=>{p(),w.current=null},a))},[a,f,p,...n]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:i!=null};function v(){switch(d){case Er.Always:return!1;case Er.BeforeDragging:return r;default:return!r}}}function No(e,t){return wr(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Yu(e,t){return No(e,t)}function qu(e){let{callback:t,disabled:r}=e;const n=an(t),o=b.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return b.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function mn(e){let{callback:t,disabled:r}=e;const n=an(t),o=b.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return b.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Xu(e){return new vo(Gt(e),e)}function Os(e,t,r){t===void 0&&(t=Xu);const[n,o]=b.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=l??r)!=null?d:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const s=qu({callback(l){if(e)for(const d of l){const{type:u,target:f}=d;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=mn({callback:i});return Qe(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),n}function Ju(e){const t=No(e);return gs(e,t)}const Is=[];function Zu(e){const t=b.useRef(e),r=wr(n=>e?n&&n!==Is&&e&&t.current&&e.parentNode===t.current.parentNode?n:pn(e):Is,[e]);return b.useEffect(()=>{t.current=e},[e]),r}function Qu(e){const[t,r]=b.useState(null),n=b.useRef(e),o=b.useCallback(i=>{const s=go(i.target);s&&r(a=>a?(a.set(s,bo(s)),new Map(a)):null)},[]);return b.useEffect(()=>{const i=n.current;if(e!==i){s(i);const a=e.map(l=>{const d=go(l);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,bo(d)]):null}).filter(l=>l!=null);r(a.length?new Map(a):null),n.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const d=go(l);d==null||d.removeEventListener("scroll",o)})}},[o,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Kt(i,s),et):Cs(e):et,[e,t])}function Ds(e,t){t===void 0&&(t=[]);const r=b.useRef(null);return b.useEffect(()=>{r.current=null},t),b.useEffect(()=>{const n=e!==et;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?kr(e,r.current):et}function ef(e){b.useEffect(()=>{if(!sn)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function tf(e,t){return b.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:i}=n;return r[o]=s=>{i(s,t)},r},{}),[e,t])}function _s(e){return b.useMemo(()=>e?ju(e):null,[e])}const Ms=[];function rf(e,t){t===void 0&&(t=Gt);const[r]=e,n=_s(r?Fe(r):null),[o,i]=b.useState(Ms);function s(){i(()=>e.length?e.map(l=>ks(l)?n:new vo(t(l),l)):Ms)}const a=mn({callback:s});return Qe(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function Rs(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return vr(t)?t:e}function nf(e){let{measure:t}=e;const[r,n]=b.useState(null),o=b.useCallback(d=>{for(const{target:u}of d)if(vr(u)){n(f=>{const h=t(u);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=mn({callback:o}),s=b.useCallback(d=>{const u=Rs(d);i==null||i.disconnect(),u&&(i==null||i.observe(u)),n(u?t(u):null)},[t,i]),[a,l]=ln(s);return b.useMemo(()=>({nodeRef:a,rect:r,setRef:l}),[r,a,l])}const of=[{sensor:ko,options:{}},{sensor:wo,options:{}}],sf={current:{}},gn={draggable:{measure:vs},droppable:{measure:vs,strategy:Er.WhileDragging,frequency:Eo.Optimized},dragOverlay:{measure:Gt}};class Nr extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const af={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Nr,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:fn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:gn,measureDroppableContainers:fn,windowRect:null,measuringScheduled:!1},Ls={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:fn,draggableNodes:new Map,over:null,measureDroppableContainers:fn},jr=b.createContext(Ls),$s=b.createContext(af);function lf(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Nr}}}function cf(e,t){switch(t.type){case Te.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Te.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Te.DragEnd:case Te.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Te.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new Nr(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case Te.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const s=new Nr(e.droppable.containers);return s.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case Te.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new Nr(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function df(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=b.useContext(jr),i=cn(n),s=cn(r==null?void 0:r.id);return b.useEffect(()=>{if(!t&&!n&&i&&s!=null){if(!dn(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:d}=a;if(!l.current&&!d.current)return;requestAnimationFrame(()=>{for(const u of[l.current,d.current]){if(!u)continue;const f=iu(u);if(f){f.focus();break}}})}},[n,t,o,s,i]),null}function Fs(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...n}),r):r}function uf(e){return b.useMemo(()=>({draggable:{...gn.draggable,...e==null?void 0:e.draggable},droppable:{...gn.droppable,...e==null?void 0:e.droppable},dragOverlay:{...gn.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function ff(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const i=b.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;Qe(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!n)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const u=r(d),f=gs(u,n);if(s||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=xs(d);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,n,r])}const bn=b.createContext({...et,scaleX:1,scaleY:1});var wt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(wt||(wt={}));const pf=b.memo(function(t){var r,n,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:d,sensors:u=of,collisionDetection:f=yu,measuring:h,modifiers:p,...w}=t;const m=b.useReducer(cf,void 0,lf),[v,y]=m,[k,x]=uu(),[S,C]=b.useState(wt.Uninitialized),E=S===wt.Initialized,{draggable:{active:j,nodes:N,translate:_},droppable:{containers:R}}=v,I=j!=null?N.get(j):null,L=b.useRef({initial:null,translated:null}),M=b.useMemo(()=>{var Ce;return j!=null?{id:j,data:(Ce=I==null?void 0:I.data)!=null?Ce:sf,rect:L}:null},[j,I]),Y=b.useRef(null),[H,U]=b.useState(null),[B,T]=b.useState(null),X=xr(w,Object.values(w)),re=yr("DndDescribedBy",s),A=b.useMemo(()=>R.getEnabled(),[R]),W=uf(h),{droppableRects:q,measureDroppableContainers:G,measuringScheduled:me}=Gu(A,{dragging:E,dependencies:[_.x,_.y],config:W.droppable}),se=Vu(N,j),P=b.useMemo(()=>B?un(B):null,[B]),J=it(),te=Yu(se,W.draggable.measure);ff({activeNode:j!=null?N.get(j):null,config:J.layoutShiftCompensation,initialRect:te,measure:W.draggable.measure});const F=Os(se,W.draggable.measure,te),ne=Os(se?se.parentElement:null),Q=b.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),xe=R.getNodeFor((r=Q.current.over)==null?void 0:r.id),ge=nf({measure:W.dragOverlay.measure}),ze=(n=ge.nodeRef.current)!=null?n:se,Oe=E?(o=ge.rect)!=null?o:F:null,Be=!!(ge.nodeRef.current&&ge.rect),jt=Ju(Be?null:F),Xe=_s(ze?Fe(ze):null),He=Zu(E?xe??se:null),Ve=rf(He),mt=Fs(p,{transform:{x:_.x-jt.x,y:_.y-jt.y,scaleX:1,scaleY:1},activatorEvent:B,active:M,activeNodeRect:F,containerNodeRect:ne,draggingNodeRect:Oe,over:Q.current.over,overlayNodeRect:ge.rect,scrollableAncestors:He,scrollableAncestorRects:Ve,windowRect:Xe}),ot=P?Kt(P,_):null,At=Qu(He),Wr=Ds(At),D=Ds(At,[F]),ee=Kt(mt,Wr),ie=Oe?Cu(Oe,mt):null,fe=M&&ie?f({active:M,collisionRect:ie,droppableRects:q,droppableContainers:A,pointerCoordinates:ot}):null,Ie=hs(fe,"id"),[ye,Ee]=b.useState(null),z=Be?mt:Kt(mt,D),O=ku(z,(i=ye==null?void 0:ye.rect)!=null?i:null,F),$=b.useRef(null),Z=b.useCallback((Ce,Re)=>{let{sensor:Le,options:Se}=Re;if(Y.current==null)return;const $e=N.get(Y.current);if(!$e)return;const De=Ce.nativeEvent,Ke=new Le({active:Y.current,activeNode:$e,event:De,options:Se,context:Q,onAbort(_e){if(!N.get(_e))return;const{onDragAbort:ut}=X.current,gt={id:_e};ut==null||ut(gt),k({type:"onDragAbort",event:gt})},onPending(_e,Tt,ut,gt){if(!N.get(_e))return;const{onDragPending:Br}=X.current,zt={id:_e,constraint:Tt,initialCoordinates:ut,offset:gt};Br==null||Br(zt),k({type:"onDragPending",event:zt})},onStart(_e){const Tt=Y.current;if(Tt==null)return;const ut=N.get(Tt);if(!ut)return;const{onDragStart:gt}=X.current,Ur={activatorEvent:De,active:{id:Tt,data:ut.data,rect:L}};bt.unstable_batchedUpdates(()=>{gt==null||gt(Ur),C(wt.Initializing),y({type:Te.DragStart,initialCoordinates:_e,active:Tt}),k({type:"onDragStart",event:Ur}),U($.current),T(De)})},onMove(_e){y({type:Te.DragMove,coordinates:_e})},onEnd:Ue(Te.DragEnd),onCancel:Ue(Te.DragCancel)});$.current=Ke;function Ue(_e){return async function(){const{active:ut,collisions:gt,over:Ur,scrollAdjustedTranslate:Br}=Q.current;let zt=null;if(ut&&Br){const{cancelDrop:Hr}=X.current;zt={activatorEvent:De,active:ut,collisions:gt,delta:Br,over:Ur},_e===Te.DragEnd&&typeof Hr=="function"&&await Promise.resolve(Hr(zt))&&(_e=Te.DragCancel)}Y.current=null,bt.unstable_batchedUpdates(()=>{y({type:_e}),C(wt.Uninitialized),Ee(null),U(null),T(null),$.current=null;const Hr=_e===Te.DragEnd?"onDragEnd":"onDragCancel";if(zt){const ji=X.current[Hr];ji==null||ji(zt),k({type:Hr,event:zt})}})}}},[N]),ce=b.useCallback((Ce,Re)=>(Le,Se)=>{const $e=Le.nativeEvent,De=N.get(Se);if(Y.current!==null||!De||$e.dndKit||$e.defaultPrevented)return;const Ke={active:De};Ce(Le,Re.options,Ke)===!0&&($e.dndKit={capturedBy:Re.sensor},Y.current=Se,Z(Le,Re))},[N,Z]),de=Ku(u,ce);ef(u),Qe(()=>{F&&S===wt.Initializing&&C(wt.Initialized)},[F,S]),b.useEffect(()=>{const{onDragMove:Ce}=X.current,{active:Re,activatorEvent:Le,collisions:Se,over:$e}=Q.current;if(!Re||!Le)return;const De={active:Re,activatorEvent:Le,collisions:Se,delta:{x:ee.x,y:ee.y},over:$e};bt.unstable_batchedUpdates(()=>{Ce==null||Ce(De),k({type:"onDragMove",event:De})})},[ee.x,ee.y]),b.useEffect(()=>{const{active:Ce,activatorEvent:Re,collisions:Le,droppableContainers:Se,scrollAdjustedTranslate:$e}=Q.current;if(!Ce||Y.current==null||!Re||!$e)return;const{onDragOver:De}=X.current,Ke=Se.get(Ie),Ue=Ke&&Ke.rect.current?{id:Ke.id,rect:Ke.rect.current,data:Ke.data,disabled:Ke.disabled}:null,_e={active:Ce,activatorEvent:Re,collisions:Le,delta:{x:$e.x,y:$e.y},over:Ue};bt.unstable_batchedUpdates(()=>{Ee(Ue),De==null||De(_e),k({type:"onDragOver",event:_e})})},[Ie]),Qe(()=>{Q.current={activatorEvent:B,active:M,activeNode:se,collisionRect:ie,collisions:fe,droppableRects:q,draggableNodes:N,draggingNode:ze,draggingNodeRect:Oe,droppableContainers:R,over:ye,scrollableAncestors:He,scrollAdjustedTranslate:ee},L.current={initial:Oe,translated:ie}},[M,se,fe,ie,N,ze,Oe,q,R,ye,He,ee]),Uu({...J,delta:_,draggingRect:ie,pointerCoordinates:ot,scrollableAncestors:He,scrollableAncestorRects:Ve});const be=b.useMemo(()=>({active:M,activeNode:se,activeNodeRect:F,activatorEvent:B,collisions:fe,containerNodeRect:ne,dragOverlay:ge,draggableNodes:N,droppableContainers:R,droppableRects:q,over:ye,measureDroppableContainers:G,scrollableAncestors:He,scrollableAncestorRects:Ve,measuringConfiguration:W,measuringScheduled:me,windowRect:Xe}),[M,se,F,B,fe,ne,ge,N,R,q,ye,G,He,Ve,W,me,Xe]),Ne=b.useMemo(()=>({activatorEvent:B,activators:de,active:M,activeNodeRect:F,ariaDescribedById:{draggable:re},dispatch:y,draggableNodes:N,over:ye,measureDroppableContainers:G}),[B,de,M,F,y,re,N,ye,G]);return b.createElement(ds.Provider,{value:x},b.createElement(jr.Provider,{value:Ne},b.createElement($s.Provider,{value:be},b.createElement(bn.Provider,{value:O},d)),b.createElement(df,{disabled:(a==null?void 0:a.restoreFocus)===!1})),b.createElement(hu,{...a,hiddenTextDescribedById:re}));function it(){const Ce=(H==null?void 0:H.autoScrollEnabled)===!1,Re=typeof l=="object"?l.enabled===!1:l===!1,Le=E&&!Ce&&!Re;return typeof l=="object"?{...l,enabled:Le}:{enabled:Le}}}),hf=b.createContext(null),Ws="button",mf="Draggable";function gf(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const i=yr(mf),{activators:s,activatorEvent:a,active:l,activeNodeRect:d,ariaDescribedById:u,draggableNodes:f,over:h}=b.useContext(jr),{role:p=Ws,roleDescription:w="draggable",tabIndex:m=0}=o??{},v=(l==null?void 0:l.id)===t,y=b.useContext(v?bn:hf),[k,x]=ln(),[S,C]=ln(),E=tf(s,t),j=xr(r);Qe(()=>(f.set(t,{id:t,key:i,node:k,activatorNode:S,data:j}),()=>{const _=f.get(t);_&&_.key===i&&f.delete(t)}),[f,t]);const N=b.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":n,"aria-pressed":v&&p===Ws?!0:void 0,"aria-roledescription":w,"aria-describedby":u.draggable}),[n,p,m,v,w,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:d,attributes:N,isDragging:v,listeners:n?void 0:E,node:k,over:h,setNodeRef:x,setActivatorNodeRef:C,transform:y}}function Us(){return b.useContext($s)}const bf="Droppable",vf={timeout:25};function xf(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const i=yr(bf),{active:s,dispatch:a,over:l,measureDroppableContainers:d}=b.useContext(jr),u=b.useRef({disabled:r}),f=b.useRef(!1),h=b.useRef(null),p=b.useRef(null),{disabled:w,updateMeasurementsFor:m,timeout:v}={...vf,...o},y=xr(m??n),k=b.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{d(Array.isArray(y.current)?y.current:[y.current]),p.current=null},v)},[v]),x=mn({callback:k,disabled:w||!s}),S=b.useCallback((N,_)=>{x&&(_&&(x.unobserve(_),f.current=!1),N&&x.observe(N))},[x]),[C,E]=ln(S),j=xr(t);return b.useEffect(()=>{!x||!C.current||(x.disconnect(),f.current=!1,x.observe(C.current))},[C,x]),b.useEffect(()=>(a({type:Te.RegisterDroppable,element:{id:n,key:i,disabled:r,node:C,rect:h,data:j}}),()=>a({type:Te.UnregisterDroppable,key:i,id:n})),[n]),b.useEffect(()=>{r!==u.current.disabled&&(a({type:Te.SetDroppableDisabled,id:n,key:i,disabled:r}),u.current.disabled=r)},[n,i,r,a]),{active:s,rect:h,isOver:(l==null?void 0:l.id)===n,node:C,over:l,setNodeRef:E}}function wf(e){let{animation:t,children:r}=e;const[n,o]=b.useState(null),[i,s]=b.useState(null),a=cn(r);return!r&&!n&&a&&o(a),Qe(()=>{if(!i)return;const l=n==null?void 0:n.key,d=n==null?void 0:n.props.id;if(l==null||d==null){o(null);return}Promise.resolve(t(d,i)).then(()=>{o(null)})},[t,n,i]),b.createElement(b.Fragment,null,r,n?b.cloneElement(n,{ref:s}):null)}const yf={x:0,y:0,scaleX:1,scaleY:1};function kf(e){let{children:t}=e;return b.createElement(jr.Provider,{value:Ls},b.createElement(bn.Provider,{value:yf},t))}const Sf={position:"fixed",touchAction:"none"},Cf=e=>dn(e)?"transform 250ms ease":void 0,Ef=b.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:o,children:i,className:s,rect:a,style:l,transform:d,transition:u=Cf}=e;if(!a)return null;const f=o?d:{...d,scaleX:1,scaleY:1},h={...Sf,width:a.width,height:a.height,top:a.top,left:a.left,transform:xt.Transform.toString(f),transformOrigin:o&&n?gu(n,a):void 0,transition:typeof u=="function"?u(n):u,...l};return b.createElement(r,{className:s,style:h,ref:t},i)}),Nf={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:xt.Transform.toString(t)},{transform:xt.Transform.toString(r)}]},sideEffects:(e=>t=>{let{active:r,dragOverlay:n}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(o[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&n.node.style.setProperty(a,l);return s!=null&&s.active&&r.node.classList.add(s.active),s!=null&&s.dragOverlay&&n.node.classList.add(s.dragOverlay),function(){for(const[l,d]of Object.entries(o))r.node.style.setProperty(l,d);s!=null&&s.active&&r.node.classList.remove(s.active)}})({styles:{active:{opacity:"0"}}})};function jf(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:o}=e;return an((i,s)=>{if(t===null)return;const a=r.get(i);if(!a)return;const l=a.node.current;if(!l)return;const d=Rs(s);if(!d)return;const{transform:u}=Fe(s).getComputedStyle(s),f=bs(u);if(!f)return;const h=typeof t=="function"?t:Af(t);return Es(l,o.draggable.measure),h({active:{id:i,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:s,rect:o.dragOverlay.measure(d)},droppableContainers:n,measuringConfiguration:o,transform:f})})}function Af(e){const{duration:t,easing:r,sideEffects:n,keyframes:o}={...Nf,...e};return i=>{let{active:s,dragOverlay:a,transform:l,...d}=i;if(!t)return;const u={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},f={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-u.x,y:l.y-u.y,...f},p=o({...d,active:s,dragOverlay:a,transform:{initial:l,final:h}}),[w]=p,m=p[p.length-1];if(JSON.stringify(w)===JSON.stringify(m))return;const v=n==null?void 0:n({active:s,dragOverlay:a,...d}),y=a.node.animate(p,{duration:t,easing:r,fill:"forwards"});return new Promise(k=>{y.onfinish=()=>{v==null||v(),k()}})}}let Bs=0;function Tf(e){return b.useMemo(()=>{if(e!=null)return Bs++,Bs},[e])}const zf=b.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:d=999}=e;const{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggableNodes:w,droppableContainers:m,dragOverlay:v,over:y,measuringConfiguration:k,scrollableAncestors:x,scrollableAncestorRects:S,windowRect:C}=Us(),E=b.useContext(bn),j=Tf(f==null?void 0:f.id),N=Fs(s,{activatorEvent:u,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:x,scrollableAncestorRects:S,transform:E,windowRect:C}),_=No(h),R=jf({config:n,draggableNodes:w,droppableContainers:m,measuringConfiguration:k}),I=_?v.setRef:void 0;return b.createElement(kf,null,b.createElement(wf,{animation:R},f&&j?b.createElement(Ef,{key:j,id:f.id,ref:I,as:a,activatorEvent:u,adjustScale:t,className:l,transition:i,rect:_,style:{zIndex:d,...o},transform:N},r):null))}),Pf=e=>{let{transform:t}=e;return{...t,x:0}};function Hs(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function Of(e,t){return e.reduce((r,n,o)=>{const i=t.get(n);return i&&(r[o]=i),r},Array(e.length))}function vn(e){return e!==null&&e>=0}function If(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Df(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Vs=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const i=Hs(t,n,r),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},xn={scaleX:1,scaleY:1},_f=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:i,overIndex:s}=e;const a=(t=i[r])!=null?t:n;if(!a)return null;if(o===r){const d=i[s];return d?{x:0,y:r<s?d.top+d.height-(a.top+a.height):d.top-a.top,...xn}:null}const l=Mf(i,o,r);return o>r&&o<=s?{x:0,y:-a.height-l,...xn}:o<r&&o>=s?{x:0,y:a.height+l,...xn}:{x:0,y:0,...xn}};function Mf(e,t,r){const n=e[t],o=e[t-1],i=e[t+1];return n?r<t?o?n.top-(o.top+o.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):o?n.top-(o.top+o.height):0:0}const Ks="Sortable",Gs=b.createContext({activeIndex:-1,containerId:Ks,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Vs,disabled:{draggable:!1,droppable:!1}});function Rf(e){let{children:t,id:r,items:n,strategy:o=Vs,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:d,measureDroppableContainers:u}=Us(),f=yr(Ks,r),h=a.rect!==null,p=b.useMemo(()=>n.map(E=>typeof E=="object"&&"id"in E?E.id:E),[n]),w=s!=null,m=s?p.indexOf(s.id):-1,v=d?p.indexOf(d.id):-1,y=b.useRef(p),k=!If(p,y.current),x=v!==-1&&m===-1||k,S=Df(i);Qe(()=>{k&&w&&u(p)},[k,p,w,u]),b.useEffect(()=>{y.current=p},[p]);const C=b.useMemo(()=>({activeIndex:m,containerId:f,disabled:S,disableTransforms:x,items:p,overIndex:v,useDragOverlay:h,sortedRects:Of(p,l),strategy:o}),[m,f,S.draggable,S.droppable,x,p,v,l,h,o]);return b.createElement(Gs.Provider,{value:C},t)}const Lf=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Hs(r,n,o).indexOf(t)},$f=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:d}=e;return!d||!n||a!==i&&o===s?!1:r?!0:s!==o&&t===l},Ff={duration:200,easing:"ease"},Ys="transform",Wf=xt.Transition.toString({property:Ys,duration:0,easing:"linear"}),Uf={roleDescription:"sortable"};function Bf(e){let{disabled:t,index:r,node:n,rect:o}=e;const[i,s]=b.useState(null),a=b.useRef(r);return Qe(()=>{if(!t&&r!==a.current&&n.current){const l=o.current;if(l){const d=Gt(n.current,{ignoreTransform:!0}),u={x:l.left-d.left,y:l.top-d.top,scaleX:l.width/d.width,scaleY:l.height/d.height};(u.x||u.y)&&s(u)}}r!==a.current&&(a.current=r)},[t,r,n,o]),b.useEffect(()=>{i&&s(null)},[i]),i}function Hf(e){let{animateLayoutChanges:t=$f,attributes:r,disabled:n,data:o,getNewIndex:i=Lf,id:s,strategy:a,resizeObserverConfig:l,transition:d=Ff}=e;const{items:u,containerId:f,activeIndex:h,disabled:p,disableTransforms:w,sortedRects:m,overIndex:v,useDragOverlay:y,strategy:k}=b.useContext(Gs),x=Vf(n,p),S=u.indexOf(s),C=b.useMemo(()=>({sortable:{containerId:f,index:S,items:u},...o}),[f,o,S,u]),E=b.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:j,node:N,isOver:_,setNodeRef:R}=xf({id:s,data:C,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...l}}),{active:I,activatorEvent:L,activeNodeRect:M,attributes:Y,setNodeRef:H,listeners:U,isDragging:B,over:T,setActivatorNodeRef:X,transform:re}=gf({id:s,data:C,attributes:{...Uf,...r},disabled:x.draggable}),A=tu(R,H),W=!!I,q=W&&!w&&vn(h)&&vn(v),G=!y&&B,me=G&&q?re:null,P=q?me??(a??k)({rects:m,activeNodeRect:M,activeIndex:h,overIndex:v,index:S}):null,J=vn(h)&&vn(v)?i({id:s,items:u,activeIndex:h,overIndex:v}):S,te=I==null?void 0:I.id,F=b.useRef({activeId:te,items:u,newIndex:J,containerId:f}),ne=u!==F.current.items,Q=t({active:I,containerId:f,isDragging:B,isSorting:W,id:s,index:S,items:u,newIndex:F.current.newIndex,previousItems:F.current.items,previousContainerId:F.current.containerId,transition:d,wasDragging:F.current.activeId!=null}),xe=Bf({disabled:!Q,index:S,node:N,rect:j});return b.useEffect(()=>{W&&F.current.newIndex!==J&&(F.current.newIndex=J),f!==F.current.containerId&&(F.current.containerId=f),u!==F.current.items&&(F.current.items=u)},[W,J,f,u]),b.useEffect(()=>{if(te===F.current.activeId)return;if(te!=null&&F.current.activeId==null){F.current.activeId=te;return}const ze=setTimeout(()=>{F.current.activeId=te},50);return()=>clearTimeout(ze)},[te]),{active:I,activeIndex:h,attributes:Y,data:C,rect:j,index:S,newIndex:J,items:u,isOver:_,isSorting:W,isDragging:B,listeners:U,node:N,overIndex:v,over:T,setNodeRef:A,setActivatorNodeRef:X,setDroppableNodeRef:R,setDraggableNodeRef:H,transform:xe??P,transition:ge()};function ge(){if(xe||ne&&F.current.newIndex===S)return Wf;if(!(G&&!dn(L)||!d)&&(W||Q))return xt.Transition.toString({...d,property:Ys})}}function Vf(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function wn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Kf=[ue.Down,ue.Right,ue.Up,ue.Left],Gf=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:i,over:s,scrollableAncestors:a}}=t;if(Kf.includes(e.code)){if(e.preventDefault(),!r||!n)return;const l=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=o.get(f.id);if(h)switch(e.code){case ue.Down:n.top<h.top&&l.push(f);break;case ue.Up:n.top>h.top&&l.push(f);break;case ue.Left:n.left>h.left&&l.push(f);break;case ue.Right:n.left<h.left&&l.push(f);break}});const d=xu({collisionRect:n,droppableRects:o,droppableContainers:l});let u=hs(d,"id");if(u===(s==null?void 0:s.id)&&d.length>1&&(u=d[1].id),u!=null){const f=i.get(r.id),h=i.get(u),p=h?o.get(h.id):null,w=h==null?void 0:h.node.current;if(w&&p&&f&&h){const v=pn(w).some((E,j)=>a[j]!==E),y=qs(f,h),k=Yf(f,h),x=v||!y?{x:0,y:0}:{x:k?n.width-p.width:0,y:k?n.height-p.height:0},S={x:p.left,y:p.top};return x.x&&x.y?S:kr(S,x)}}}};function qs(e,t){return!wn(e)||!wn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Yf(e,t){return!wn(e)||!wn(t)||!qs(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function jo({className:e,type:t,...r}){return c.jsx("input",{type:t,className:oe("h-8 rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-1 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600",e),...r})}function qf({className:e,...t}){return c.jsx("textarea",{className:oe("min-h-16 w-full rounded-lg border border-zinc-800 bg-zinc-900/50 px-2.5 py-2 text-sm outline-none transition-colors focus:ring-2 focus:ring-blue-600 resize-none",e),...t})}function Xf({className:e,checked:t,onCheckedChange:r,...n}){return c.jsx("input",{type:"checkbox",checked:t,onChange:o=>r==null?void 0:r(o.target.checked),className:oe("size-4 rounded border border-zinc-700 bg-zinc-900 text-blue-600 focus:ring-2 focus:ring-blue-600",e),...n})}function Dt({className:e,...t}){return c.jsx("label",{className:oe("text-sm font-medium leading-none select-none",e),...t})}function Xs(e,[t,r]){return Math.min(r,Math.max(t,e))}function pe(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Ar(e,t=[]){let r=[];function n(i,s){const a=g.createContext(s),l=r.length;r=[...r,s];const d=f=>{var y;const{scope:h,children:p,...w}=f,m=((y=h==null?void 0:h[e])==null?void 0:y[l])||a,v=g.useMemo(()=>w,Object.values(w));return c.jsx(m.Provider,{value:v,children:p})};d.displayName=i+"Provider";function u(f,h){var m;const p=((m=h==null?void 0:h[e])==null?void 0:m[l])||a,w=g.useContext(p);if(w)return w;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const o=()=>{const i=r.map(s=>g.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return g.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[n,Jf(o,...t)]}function Jf(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=n.reduce((a,{useScope:l,scopeName:d})=>{const f=l(i)[`__scope${d}`];return{...a,...f}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function Js(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zs(...e){return t=>{let r=!1;const n=e.map(o=>{const i=Js(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o<n.length;o++){const i=n[o];typeof i=="function"?i():Js(e[o],null)}}}}function ke(...e){return g.useCallback(Zs(...e),e)}function Yt(e){const t=Qf(e),r=g.forwardRef((n,o)=>{const{children:i,...s}=n,a=g.Children.toArray(i),l=a.find(tp);if(l){const d=l.props.children,u=a.map(f=>f===l?g.Children.count(d)>1?g.Children.only(null):g.isValidElement(d)?d.props.children:null:f);return c.jsx(t,{...s,ref:o,children:g.isValidElement(d)?g.cloneElement(d,void 0,u):null})}return c.jsx(t,{...s,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var Zf=Yt("Slot");function Qf(e){const t=g.forwardRef((r,n)=>{const{children:o,...i}=r;if(g.isValidElement(o)){const s=np(o),a=rp(i,o.props);return o.type!==g.Fragment&&(a.ref=n?Zs(n,s):s),g.cloneElement(o,a)}return g.Children.count(o)>1?g.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qs=Symbol("radix.slottable");function ep(e){const t=({children:r})=>c.jsx(c.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Qs,t}function tp(e){return g.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qs}function rp(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function np(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function op(e){const t=e+"CollectionProvider",[r,n]=Ar(t),[o,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:v,children:y}=m,k=b.useRef(null),x=b.useRef(new Map).current;return c.jsx(o,{scope:v,itemMap:x,collectionRef:k,children:y})};s.displayName=t;const a=e+"CollectionSlot",l=Yt(a),d=b.forwardRef((m,v)=>{const{scope:y,children:k}=m,x=i(a,y),S=ke(v,x.collectionRef);return c.jsx(l,{ref:S,children:k})});d.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",h=Yt(u),p=b.forwardRef((m,v)=>{const{scope:y,children:k,...x}=m,S=b.useRef(null),C=ke(v,S),E=i(u,y);return b.useEffect(()=>(E.itemMap.set(S,{ref:S,...x}),()=>void E.itemMap.delete(S))),c.jsx(h,{[f]:"",ref:C,children:k})});p.displayName=u;function w(m){const v=i(e+"CollectionConsumer",m);return b.useCallback(()=>{const k=v.collectionRef.current;if(!k)return[];const x=Array.from(k.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((E,j)=>x.indexOf(E.ref.current)-x.indexOf(j.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:d,ItemSlot:p},w,n]}var ip=g.createContext(void 0);function sp(e){const t=g.useContext(ip);return e||t||"ltr"}var ap=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],we=ap.reduce((e,t)=>{const r=Yt(`Primitive.${t}`),n=g.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lp(e,t){e&&Vr.flushSync(()=>e.dispatchEvent(t))}function _t(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function cp(e,t=globalThis==null?void 0:globalThis.document){const r=_t(e);g.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var dp="DismissableLayer",Ao="dismissableLayer.update",up="dismissableLayer.pointerDownOutside",fp="dismissableLayer.focusOutside",ea,ta=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yn=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,d=g.useContext(ta),[u,f]=g.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=g.useState({}),w=ke(t,j=>f(j)),m=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),k=u?m.indexOf(u):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=k>=y,C=mp(j=>{const N=j.target,_=[...d.branches].some(R=>R.contains(N));!S||_||(o==null||o(j),s==null||s(j),j.defaultPrevented||a==null||a())},h),E=gp(j=>{const N=j.target;[...d.branches].some(R=>R.contains(N))||(i==null||i(j),s==null||s(j),j.defaultPrevented||a==null||a())},h);return cp(j=>{k===d.layers.size-1&&(n==null||n(j),!j.defaultPrevented&&a&&(j.preventDefault(),a()))},h),g.useEffect(()=>{if(u)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ea=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),ra(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=ea)}},[u,h,r,d]),g.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),ra())},[u,d]),g.useEffect(()=>{const j=()=>p({});return document.addEventListener(Ao,j),()=>document.removeEventListener(Ao,j)},[]),c.jsx(we.div,{...l,ref:w,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:pe(e.onFocusCapture,E.onFocusCapture),onBlurCapture:pe(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:pe(e.onPointerDownCapture,C.onPointerDownCapture)})});yn.displayName=dp;var pp="DismissableLayerBranch",hp=g.forwardRef((e,t)=>{const r=g.useContext(ta),n=g.useRef(null),o=ke(t,n);return g.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),c.jsx(we.div,{...e,ref:o})});hp.displayName=pp;function mp(e,t=globalThis==null?void 0:globalThis.document){const r=_t(e),n=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){na(up,r,d,{discrete:!0})};const d={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function gp(e,t=globalThis==null?void 0:globalThis.document){const r=_t(e),n=g.useRef(!1);return g.useEffect(()=>{const o=i=>{i.target&&!n.current&&na(fp,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ra(){const e=new CustomEvent(Ao);document.dispatchEvent(e)}function na(e,t,r,{discrete:n}){const o=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?lp(o,i):o.dispatchEvent(i)}var To=0;function oa(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ia()),document.body.insertAdjacentElement("beforeend",e[1]??ia()),To++,()=>{To===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),To--}},[])}function ia(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var zo="focusScope.autoFocusOnMount",Po="focusScope.autoFocusOnUnmount",sa={bubbles:!1,cancelable:!0},bp="FocusScope",Oo=g.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=g.useState(null),d=_t(o),u=_t(i),f=g.useRef(null),h=ke(t,m=>l(m)),p=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(n){let m=function(x){if(p.paused||!a)return;const S=x.target;a.contains(S)?f.current=S:yt(f.current,{select:!0})},v=function(x){if(p.paused||!a)return;const S=x.relatedTarget;S!==null&&(a.contains(S)||yt(f.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const C of x)C.removedNodes.length>0&&yt(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const k=new MutationObserver(y);return a&&k.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),k.disconnect()}}},[n,a,p.paused]),g.useEffect(()=>{if(a){ca.add(p);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(zo,sa);a.addEventListener(zo,d),a.dispatchEvent(y),y.defaultPrevented||(vp(Sp(aa(a)),{select:!0}),document.activeElement===m&&yt(a))}return()=>{a.removeEventListener(zo,d),setTimeout(()=>{const y=new CustomEvent(Po,sa);a.addEventListener(Po,u),a.dispatchEvent(y),y.defaultPrevented||yt(m??document.body,{select:!0}),a.removeEventListener(Po,u),ca.remove(p)},0)}}},[a,d,u,p]);const w=g.useCallback(m=>{if(!r&&!n||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const k=m.currentTarget,[x,S]=xp(k);x&&S?!m.shiftKey&&y===S?(m.preventDefault(),r&&yt(x,{select:!0})):m.shiftKey&&y===x&&(m.preventDefault(),r&&yt(S,{select:!0})):y===k&&m.preventDefault()}},[r,n,p.paused]);return c.jsx(we.div,{tabIndex:-1,...s,ref:h,onKeyDown:w})});Oo.displayName=bp;function vp(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(yt(n,{select:t}),document.activeElement!==r)return}function xp(e){const t=aa(e),r=la(t,e),n=la(t.reverse(),e);return[r,n]}function aa(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function la(e,t){for(const r of e)if(!wp(r,{upTo:t}))return r}function wp(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function yp(e){return e instanceof HTMLInputElement&&"select"in e}function yt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&yp(e)&&t&&e.select()}}var ca=kp();function kp(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=da(e,t),e.unshift(t)},remove(t){var r;e=da(e,t),(r=e[0])==null||r.resume()}}}function da(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Sp(e){return e.filter(t=>t.tagName!=="A")}var Me=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},Cp=g[" useId ".trim().toString()]||(()=>{}),Ep=0;function Tr(e){const[t,r]=g.useState(Cp());return Me(()=>{r(n=>n??String(Ep++))},[e]),t?`radix-${t}`:""}const Np=["top","right","bottom","left"],kt=Math.min,Ge=Math.max,kn=Math.round,Sn=Math.floor,st=e=>({x:e,y:e}),jp={left:"right",right:"left",bottom:"top",top:"bottom"},Ap={start:"end",end:"start"};function Io(e,t,r){return Ge(e,kt(t,r))}function pt(e,t){return typeof e=="function"?e(t):e}function ht(e){return e.split("-")[0]}function qt(e){return e.split("-")[1]}function Do(e){return e==="x"?"y":"x"}function _o(e){return e==="y"?"height":"width"}const Tp=new Set(["top","bottom"]);function at(e){return Tp.has(ht(e))?"y":"x"}function Mo(e){return Do(at(e))}function zp(e,t,r){r===void 0&&(r=!1);const n=qt(e),o=Mo(e),i=_o(o);let s=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Cn(s)),[s,Cn(s)]}function Pp(e){const t=Cn(e);return[Ro(e),t,Ro(t)]}function Ro(e){return e.replace(/start|end/g,t=>Ap[t])}const ua=["left","right"],fa=["right","left"],Op=["top","bottom"],Ip=["bottom","top"];function Dp(e,t,r){switch(e){case"top":case"bottom":return r?t?fa:ua:t?ua:fa;case"left":case"right":return t?Op:Ip;default:return[]}}function _p(e,t,r,n){const o=qt(e);let i=Dp(ht(e),r==="start",n);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ro)))),i}function Cn(e){return e.replace(/left|right|bottom|top/g,t=>jp[t])}function Mp(e){return{top:0,right:0,bottom:0,left:0,...e}}function pa(e){return typeof e!="number"?Mp(e):{top:e,right:e,bottom:e,left:e}}function En(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function ha(e,t,r){let{reference:n,floating:o}=e;const i=at(t),s=Mo(t),a=_o(s),l=ht(t),d=i==="y",u=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,h=n[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:n.y-o.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-o.width,y:f};break;default:p={x:n.x,y:n.y}}switch(qt(t)){case"start":p[s]-=h*(r&&d?-1:1);break;case"end":p[s]+=h*(r&&d?-1:1);break}return p}async function Rp(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=pt(t,e),w=pa(p),v=a[h?f==="floating"?"reference":"floating":f],y=En(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(v)))==null||r?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:l})),k=f==="floating"?{x:n,y:o,width:s.floating.width,height:s.floating.height}:s.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=En(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:k,offsetParent:x,strategy:l}):k);return{top:(y.top-C.top+w.top)/S.y,bottom:(C.bottom-y.bottom+w.bottom)/S.y,left:(y.left-C.left+w.left)/S.x,right:(C.right-y.right+w.right)/S.x}}const Lp=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:s}=r,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=ha(d,n,l),h=n,p={},w=0;for(let v=0;v<a.length;v++){var m;const{name:y,fn:k}=a[v],{x,y:S,data:C,reset:E}=await k({x:u,y:f,initialPlacement:n,placement:h,strategy:o,middlewareData:p,rects:d,platform:{...s,detectOverflow:(m=s.detectOverflow)!=null?m:Rp},elements:{reference:e,floating:t}});u=x??u,f=S??f,p={...p,[y]:{...p[y],...C}},E&&w<=50&&(w++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(d=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:f}=ha(d,h,l)),v=-1)}return{x:u,y:f,placement:h,strategy:o,middlewareData:p}},$p=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:d,padding:u=0}=pt(e,t)||{};if(d==null)return{};const f=pa(u),h={x:r,y:n},p=Mo(o),w=_o(p),m=await s.getDimensions(d),v=p==="y",y=v?"top":"left",k=v?"bottom":"right",x=v?"clientHeight":"clientWidth",S=i.reference[w]+i.reference[p]-h[p]-i.floating[w],C=h[p]-i.reference[p],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let j=E?E[x]:0;(!j||!await(s.isElement==null?void 0:s.isElement(E)))&&(j=a.floating[x]||i.floating[w]);const N=S/2-C/2,_=j/2-m[w]/2-1,R=kt(f[y],_),I=kt(f[k],_),L=R,M=j-m[w]-I,Y=j/2-m[w]/2+N,H=Io(L,Y,M),U=!l.arrow&&qt(o)!=null&&Y!==H&&i.reference[w]/2-(Y<L?R:I)-m[w]/2<0,B=U?Y<L?Y-L:Y-M:0;return{[p]:h[p]+B,data:{[p]:H,centerOffset:Y-H-B,...U&&{alignmentOffset:B}},reset:U}}}),Fp=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:m=!0,...v}=pt(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const y=ht(o),k=at(a),x=ht(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(d.floating)),C=h||(x||!m?[Cn(a)]:Pp(a)),E=w!=="none";!h&&E&&C.push(..._p(a,m,w,S));const j=[a,...C],N=await l.detectOverflow(t,v),_=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&_.push(N[y]),f){const Y=zp(o,s,S);_.push(N[Y[0]],N[Y[1]])}if(R=[...R,{placement:o,overflows:_}],!_.every(Y=>Y<=0)){var I,L;const Y=(((I=i.flip)==null?void 0:I.index)||0)+1,H=j[Y];if(H&&(!(f==="alignment"?k!==at(H):!1)||R.every(T=>at(T.placement)===k?T.overflows[0]>0:!0)))return{data:{index:Y,overflows:R},reset:{placement:H}};let U=(L=R.filter(B=>B.overflows[0]<=0).sort((B,T)=>B.overflows[1]-T.overflows[1])[0])==null?void 0:L.placement;if(!U)switch(p){case"bestFit":{var M;const B=(M=R.filter(T=>{if(E){const X=at(T.placement);return X===k||X==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(X=>X>0).reduce((X,re)=>X+re,0)]).sort((T,X)=>T[1]-X[1])[0])==null?void 0:M[0];B&&(U=B);break}case"initialPlacement":U=a;break}if(o!==U)return{reset:{placement:U}}}return{}}}};function ma(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ga(e){return Np.some(t=>e[t]>=0)}const Wp=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...i}=pt(e,t);switch(o){case"referenceHidden":{const s=await n.detectOverflow(t,{...i,elementContext:"reference"}),a=ma(s,r.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ga(a)}}}case"escaped":{const s=await n.detectOverflow(t,{...i,altBoundary:!0}),a=ma(s,r.floating);return{data:{escapedOffsets:a,escaped:ga(a)}}}default:return{}}}}},ba=new Set(["left","top"]);async function Up(e,t){const{placement:r,platform:n,elements:o}=e,i=await(n.isRTL==null?void 0:n.isRTL(o.floating)),s=ht(r),a=qt(r),l=at(r)==="y",d=ba.has(s)?-1:1,u=i&&l?-1:1,f=pt(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof w=="number"&&(p=a==="end"?w*-1:w),l?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const Bp=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Up(t,e);return s===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Hp=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:k,y:x}=y;return{x:k,y:x}}},...d}=pt(e,t),u={x:r,y:n},f=await i.detectOverflow(t,d),h=at(ht(o)),p=Do(h);let w=u[p],m=u[h];if(s){const y=p==="y"?"top":"left",k=p==="y"?"bottom":"right",x=w+f[y],S=w-f[k];w=Io(x,w,S)}if(a){const y=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=m+f[y],S=m-f[k];m=Io(x,m,S)}const v=l.fn({...t,[p]:w,[h]:m});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[p]:s,[h]:a}}}}}},Vp=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:d=!0}=pt(e,t),u={x:r,y:n},f=at(o),h=Do(f);let p=u[h],w=u[f];const m=pt(a,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=h==="y"?"height":"width",S=i.reference[h]-i.floating[x]+v.mainAxis,C=i.reference[h]+i.reference[x]-v.mainAxis;p<S?p=S:p>C&&(p=C)}if(d){var y,k;const x=h==="y"?"width":"height",S=ba.has(ht(o)),C=i.reference[f]-i.floating[x]+(S&&((y=s.offset)==null?void 0:y[f])||0)+(S?0:v.crossAxis),E=i.reference[f]+i.reference[x]+(S?0:((k=s.offset)==null?void 0:k[f])||0)-(S?v.crossAxis:0);w<C?w=C:w>E&&(w=E)}return{[h]:p,[f]:w}}}},Kp=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...d}=pt(e,t),u=await s.detectOverflow(t,d),f=ht(o),h=qt(o),p=at(o)==="y",{width:w,height:m}=i.floating;let v,y;f==="top"||f==="bottom"?(v=f,y=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=f,v=h==="end"?"top":"bottom");const k=m-u.top-u.bottom,x=w-u.left-u.right,S=kt(m-u[v],k),C=kt(w-u[y],x),E=!t.middlewareData.shift;let j=S,N=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(N=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(j=k),E&&!h){const R=Ge(u.left,0),I=Ge(u.right,0),L=Ge(u.top,0),M=Ge(u.bottom,0);p?N=w-2*(R!==0||I!==0?R+I:Ge(u.left,u.right)):j=m-2*(L!==0||M!==0?L+M:Ge(u.top,u.bottom))}await l({...t,availableWidth:N,availableHeight:j});const _=await s.getDimensions(a.floating);return w!==_.width||m!==_.height?{reset:{rects:!0}}:{}}}};function Nn(){return typeof window<"u"}function Xt(e){return va(e)?(e.nodeName||"").toLowerCase():"#document"}function Ye(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lt(e){var t;return(t=(va(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function va(e){return Nn()?e instanceof Node||e instanceof Ye(e).Node:!1}function tt(e){return Nn()?e instanceof Element||e instanceof Ye(e).Element:!1}function ct(e){return Nn()?e instanceof HTMLElement||e instanceof Ye(e).HTMLElement:!1}function xa(e){return!Nn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ye(e).ShadowRoot}const Gp=new Set(["inline","contents"]);function zr(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Gp.has(o)}const Yp=new Set(["table","td","th"]);function qp(e){return Yp.has(Xt(e))}const Xp=[":popover-open",":modal"];function jn(e){return Xp.some(t=>{try{return e.matches(t)}catch{return!1}})}const Jp=["transform","translate","scale","rotate","perspective"],Zp=["transform","translate","scale","rotate","perspective","filter"],Qp=["paint","layout","strict","content"];function Lo(e){const t=$o(),r=tt(e)?rt(e):e;return Jp.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Zp.some(n=>(r.willChange||"").includes(n))||Qp.some(n=>(r.contain||"").includes(n))}function eh(e){let t=St(e);for(;ct(t)&&!Jt(t);){if(Lo(t))return t;if(jn(t))return null;t=St(t)}return null}function $o(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const th=new Set(["html","body","#document"]);function Jt(e){return th.has(Xt(e))}function rt(e){return Ye(e).getComputedStyle(e)}function An(e){return tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function St(e){if(Xt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xa(e)&&e.host||lt(e);return xa(t)?t.host:t}function wa(e){const t=St(e);return Jt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ct(t)&&zr(t)?t:wa(t)}function Pr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=wa(e),i=o===((n=e.ownerDocument)==null?void 0:n.body),s=Ye(o);if(i){const a=Fo(s);return t.concat(s,s.visualViewport||[],zr(o)?o:[],a&&r?Pr(a):[])}return t.concat(o,Pr(o,[],r))}function Fo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ya(e){const t=rt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=ct(e),i=o?e.offsetWidth:r,s=o?e.offsetHeight:n,a=kn(r)!==i||kn(n)!==s;return a&&(r=i,n=s),{width:r,height:n,$:a}}function Wo(e){return tt(e)?e:e.contextElement}function Zt(e){const t=Wo(e);if(!ct(t))return st(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=ya(t);let s=(i?kn(r.width):r.width)/n,a=(i?kn(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const rh=st(0);function ka(e){const t=Ye(e);return!$o()||!t.visualViewport?rh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nh(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ye(e)?!1:t}function Mt(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),i=Wo(e);let s=st(1);t&&(n?tt(n)&&(s=Zt(n)):s=Zt(e));const a=nh(i,r,n)?ka(i):st(0);let l=(o.left+a.x)/s.x,d=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const h=Ye(i),p=n&&tt(n)?Ye(n):n;let w=h,m=Fo(w);for(;m&&n&&p!==w;){const v=Zt(m),y=m.getBoundingClientRect(),k=rt(m),x=y.left+(m.clientLeft+parseFloat(k.paddingLeft))*v.x,S=y.top+(m.clientTop+parseFloat(k.paddingTop))*v.y;l*=v.x,d*=v.y,u*=v.x,f*=v.y,l+=x,d+=S,w=Ye(m),m=Fo(w)}}return En({width:u,height:f,x:l,y:d})}function Tn(e,t){const r=An(e).scrollLeft;return t?t.left+r:Mt(lt(e)).left+r}function Sa(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Tn(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function oh(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i=o==="fixed",s=lt(n),a=t?jn(t.floating):!1;if(n===s||a&&i)return r;let l={scrollLeft:0,scrollTop:0},d=st(1);const u=st(0),f=ct(n);if((f||!f&&!i)&&((Xt(n)!=="body"||zr(s))&&(l=An(n)),ct(n))){const p=Mt(n);d=Zt(n),u.x=p.x+n.clientLeft,u.y=p.y+n.clientTop}const h=s&&!f&&!i?Sa(s,l):st(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-l.scrollLeft*d.x+u.x+h.x,y:r.y*d.y-l.scrollTop*d.y+u.y+h.y}}function ih(e){return Array.from(e.getClientRects())}function sh(e){const t=lt(e),r=An(e),n=e.ownerDocument.body,o=Ge(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Ge(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+Tn(e);const a=-r.scrollTop;return rt(n).direction==="rtl"&&(s+=Ge(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:s,y:a}}const Ca=25;function ah(e,t){const r=Ye(e),n=lt(e),o=r.visualViewport;let i=n.clientWidth,s=n.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=$o();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const d=Tn(n);if(d<=0){const u=n.ownerDocument,f=u.body,h=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,w=Math.abs(n.clientWidth-f.clientWidth-p);w<=Ca&&(i-=w)}else d<=Ca&&(i+=d);return{width:i,height:s,x:a,y:l}}const lh=new Set(["absolute","fixed"]);function ch(e,t){const r=Mt(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=ct(e)?Zt(e):st(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,d=n*i.y;return{width:s,height:a,x:l,y:d}}function Ea(e,t,r){let n;if(t==="viewport")n=ah(e,r);else if(t==="document")n=sh(lt(e));else if(tt(t))n=ch(t,r);else{const o=ka(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return En(n)}function Na(e,t){const r=St(e);return r===t||!tt(r)||Jt(r)?!1:rt(r).position==="fixed"||Na(r,t)}function dh(e,t){const r=t.get(e);if(r)return r;let n=Pr(e,[],!1).filter(a=>tt(a)&&Xt(a)!=="body"),o=null;const i=rt(e).position==="fixed";let s=i?St(e):e;for(;tt(s)&&!Jt(s);){const a=rt(s),l=Lo(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&lh.has(o.position)||zr(s)&&!l&&Na(e,s))?n=n.filter(u=>u!==s):o=a,s=St(s)}return t.set(e,n),n}function uh(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const s=[...r==="clippingAncestors"?jn(t)?[]:dh(t,this._c):[].concat(r),n],a=s[0],l=s.reduce((d,u)=>{const f=Ea(t,u,o);return d.top=Ge(f.top,d.top),d.right=kt(f.right,d.right),d.bottom=kt(f.bottom,d.bottom),d.left=Ge(f.left,d.left),d},Ea(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function fh(e){const{width:t,height:r}=ya(e);return{width:t,height:r}}function ph(e,t,r){const n=ct(t),o=lt(t),i=r==="fixed",s=Mt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=st(0);function d(){l.x=Tn(o)}if(n||!n&&!i)if((Xt(t)!=="body"||zr(o))&&(a=An(t)),n){const p=Mt(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&d();i&&!n&&o&&d();const u=o&&!n&&!i?Sa(o,a):st(0),f=s.left+a.scrollLeft-l.x-u.x,h=s.top+a.scrollTop-l.y-u.y;return{x:f,y:h,width:s.width,height:s.height}}function Uo(e){return rt(e).position==="static"}function ja(e,t){if(!ct(e)||rt(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return lt(e)===r&&(r=r.ownerDocument.body),r}function Aa(e,t){const r=Ye(e);if(jn(e))return r;if(!ct(e)){let o=St(e);for(;o&&!Jt(o);){if(tt(o)&&!Uo(o))return o;o=St(o)}return r}let n=ja(e,t);for(;n&&qp(n)&&Uo(n);)n=ja(n,t);return n&&Jt(n)&&Uo(n)&&!Lo(n)?r:n||eh(e)||r}const hh=async function(e){const t=this.getOffsetParent||Aa,r=this.getDimensions,n=await r(e.floating);return{reference:ph(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function mh(e){return rt(e).direction==="rtl"}const gh={convertOffsetParentRelativeRectToViewportRelativeRect:oh,getDocumentElement:lt,getClippingRect:uh,getOffsetParent:Aa,getElementRects:hh,getClientRects:ih,getDimensions:fh,getScale:Zt,isElement:tt,isRTL:mh};function Ta(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bh(e,t){let r=null,n;const o=lt(e);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const d=e.getBoundingClientRect(),{left:u,top:f,width:h,height:p}=d;if(a||t(),!h||!p)return;const w=Sn(f),m=Sn(o.clientWidth-(u+h)),v=Sn(o.clientHeight-(f+p)),y=Sn(u),x={rootMargin:-w+"px "+-m+"px "+-v+"px "+-y+"px",threshold:Ge(0,kt(1,l))||1};let S=!0;function C(E){const j=E[0].intersectionRatio;if(j!==l){if(!S)return s();j?s(!1,j):n=setTimeout(()=>{s(!1,1e-7)},1e3)}j===1&&!Ta(d,e.getBoundingClientRect())&&s(),S=!1}try{r=new IntersectionObserver(C,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(C,x)}r.observe(e)}return s(!0),i}function vh(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,d=Wo(e),u=o||i?[...d?Pr(d):[],...Pr(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),i&&y.addEventListener("resize",r)});const f=d&&a?bh(d,r):null;let h=-1,p=null;s&&(p=new ResizeObserver(y=>{let[k]=y;k&&k.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),r()}),d&&!l&&p.observe(d),p.observe(t));let w,m=l?Mt(e):null;l&&v();function v(){const y=Mt(e);m&&!Ta(m,y)&&r(),m=y,w=requestAnimationFrame(v)}return r(),()=>{var y;u.forEach(k=>{o&&k.removeEventListener("scroll",r),i&&k.removeEventListener("resize",r)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(w)}}const xh=Bp,wh=Hp,yh=Fp,kh=Kp,Sh=Wp,za=$p,Ch=Vp,Eh=(e,t,r)=>{const n=new Map,o={platform:gh,...r},i={...o.platform,_c:n};return Lp(e,t,{...o,platform:i})};var Nh=typeof document<"u",jh=function(){},zn=Nh?b.useLayoutEffect:jh;function Pn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Pn(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const i=o[n];if(!(i==="_owner"&&e.$$typeof)&&!Pn(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Pa(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Oa(e,t){const r=Pa(e);return Math.round(t*r)/r}function Bo(e){const t=g.useRef(e);return zn(()=>{t.current=e}),t}function Ah(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:d}=e,[u,f]=g.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=g.useState(n);Pn(h,n)||p(n);const[w,m]=g.useState(null),[v,y]=g.useState(null),k=g.useCallback(T=>{T!==E.current&&(E.current=T,m(T))},[]),x=g.useCallback(T=>{T!==j.current&&(j.current=T,y(T))},[]),S=i||w,C=s||v,E=g.useRef(null),j=g.useRef(null),N=g.useRef(u),_=l!=null,R=Bo(l),I=Bo(o),L=Bo(d),M=g.useCallback(()=>{if(!E.current||!j.current)return;const T={placement:t,strategy:r,middleware:h};I.current&&(T.platform=I.current),Eh(E.current,j.current,T).then(X=>{const re={...X,isPositioned:L.current!==!1};Y.current&&!Pn(N.current,re)&&(N.current=re,Vr.flushSync(()=>{f(re)}))})},[h,t,r,I,L]);zn(()=>{d===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[d]);const Y=g.useRef(!1);zn(()=>(Y.current=!0,()=>{Y.current=!1}),[]),zn(()=>{if(S&&(E.current=S),C&&(j.current=C),S&&C){if(R.current)return R.current(S,C,M);M()}},[S,C,M,R,_]);const H=g.useMemo(()=>({reference:E,floating:j,setReference:k,setFloating:x}),[k,x]),U=g.useMemo(()=>({reference:S,floating:C}),[S,C]),B=g.useMemo(()=>{const T={position:r,left:0,top:0};if(!U.floating)return T;const X=Oa(U.floating,u.x),re=Oa(U.floating,u.y);return a?{...T,transform:"translate("+X+"px, "+re+"px)",...Pa(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:X,top:re}},[r,a,U.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:M,refs:H,elements:U,floatingStyles:B}),[u,M,H,U,B])}const Th=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?za({element:n.current,padding:o}).fn(r):{}:n?za({element:n,padding:o}).fn(r):{}}}},zh=(e,t)=>({...xh(e),options:[e,t]}),Ph=(e,t)=>({...wh(e),options:[e,t]}),Oh=(e,t)=>({...Ch(e),options:[e,t]}),Ih=(e,t)=>({...yh(e),options:[e,t]}),Dh=(e,t)=>({...kh(e),options:[e,t]}),_h=(e,t)=>({...Sh(e),options:[e,t]}),Mh=(e,t)=>({...Th(e),options:[e,t]});var Rh="Arrow",Ia=g.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return c.jsx(we.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});Ia.displayName=Rh;var Lh=Ia;function $h(e){const[t,r]=g.useState(void 0);return Me(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,d=Array.isArray(l)?l[0]:l;s=d.inlineSize,a=d.blockSize}else s=e.offsetWidth,a=e.offsetHeight;r({width:s,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Ho="Popper",[Da,Qt]=Ar(Ho),[Fh,_a]=Da(Ho),Ma=e=>{const{__scopePopper:t,children:r}=e,[n,o]=g.useState(null);return c.jsx(Fh,{scope:t,anchor:n,onAnchorChange:o,children:r})};Ma.displayName=Ho;var Ra="PopperAnchor",La=g.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,i=_a(Ra,r),s=g.useRef(null),a=ke(t,s),l=g.useRef(null);return g.useEffect(()=>{const d=l.current;l.current=(n==null?void 0:n.current)||s.current,d!==l.current&&i.onAnchorChange(l.current)}),n?null:c.jsx(we.div,{...o,ref:a})});La.displayName=Ra;var Vo="PopperContent",[Wh,Uh]=Da(Vo),$a=g.forwardRef((e,t)=>{var P,J,te,F,ne,Q;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:w,...m}=e,v=_a(Vo,r),[y,k]=g.useState(null),x=ke(t,xe=>k(xe)),[S,C]=g.useState(null),E=$h(S),j=(E==null?void 0:E.width)??0,N=(E==null?void 0:E.height)??0,_=n+(i!=="center"?"-"+i:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},I=Array.isArray(d)?d:[d],L=I.length>0,M={padding:R,boundary:I.filter(Hh),altBoundary:L},{refs:Y,floatingStyles:H,placement:U,isPositioned:B,middlewareData:T}=Ah({strategy:"fixed",placement:_,whileElementsMounted:(...xe)=>vh(...xe,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[zh({mainAxis:o+N,alignmentAxis:s}),l&&Ph({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?Oh():void 0,...M}),l&&Ih({...M}),Dh({...M,apply:({elements:xe,rects:ge,availableWidth:ze,availableHeight:Oe})=>{const{width:Be,height:jt}=ge.reference,Xe=xe.floating.style;Xe.setProperty("--radix-popper-available-width",`${ze}px`),Xe.setProperty("--radix-popper-available-height",`${Oe}px`),Xe.setProperty("--radix-popper-anchor-width",`${Be}px`),Xe.setProperty("--radix-popper-anchor-height",`${jt}px`)}}),S&&Mh({element:S,padding:a}),Vh({arrowWidth:j,arrowHeight:N}),h&&_h({strategy:"referenceHidden",...M})]}),[X,re]=Ua(U),A=_t(w);Me(()=>{B&&(A==null||A())},[B,A]);const W=(P=T.arrow)==null?void 0:P.x,q=(J=T.arrow)==null?void 0:J.y,G=((te=T.arrow)==null?void 0:te.centerOffset)!==0,[me,se]=g.useState();return Me(()=>{y&&se(window.getComputedStyle(y).zIndex)},[y]),c.jsx("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:B?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(F=T.transformOrigin)==null?void 0:F.x,(ne=T.transformOrigin)==null?void 0:ne.y].join(" "),...((Q=T.hide)==null?void 0:Q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(Wh,{scope:r,placedSide:X,onArrowChange:C,arrowX:W,arrowY:q,shouldHideArrow:G,children:c.jsx(we.div,{"data-side":X,"data-align":re,...m,ref:x,style:{...m.style,animation:B?void 0:"none"}})})})});$a.displayName=Vo;var Fa="PopperArrow",Bh={top:"bottom",right:"left",bottom:"top",left:"right"},Wa=g.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,i=Uh(Fa,n),s=Bh[i.placedSide];return c.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:c.jsx(Lh,{...o,ref:r,style:{...o.style,display:"block"}})})});Wa.displayName=Fa;function Hh(e){return e!==null}var Vh=e=>({name:"transformOrigin",options:e,fn(t){var v,y,k;const{placement:r,rects:n,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[d,u]=Ua(r),f={start:"0%",center:"50%",end:"100%"}[u],h=(((y=o.arrow)==null?void 0:y.x)??0)+a/2,p=(((k=o.arrow)==null?void 0:k.y)??0)+l/2;let w="",m="";return d==="bottom"?(w=s?f:`${h}px`,m=`${-l}px`):d==="top"?(w=s?f:`${h}px`,m=`${n.floating.height+l}px`):d==="right"?(w=`${-l}px`,m=s?f:`${p}px`):d==="left"&&(w=`${n.floating.width+l}px`,m=s?f:`${p}px`),{data:{x:w,y:m}}}});function Ua(e){const[t,r="center"]=e.split("-");return[t,r]}var Ko=Ma,On=La,Go=$a,Yo=Wa,Kh="Portal",In=g.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[o,i]=g.useState(!1);Me(()=>i(!0),[]);const s=r||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?bt.createPortal(c.jsx(we.div,{...n,ref:t}),s):null});In.displayName=Kh;var Gh=g[" useInsertionEffect ".trim().toString()]||Me;function Dn({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,i,s]=Yh({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:o;{const u=g.useRef(e!==void 0);g.useEffect(()=>{const f=u.current;f!==a&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,n])}const d=g.useCallback(u=>{var f;if(a){const h=qh(u)?u(e):u;h!==e&&((f=s.current)==null||f.call(s,h))}else i(u)},[a,e,i,s]);return[l,d]}function Yh({defaultProp:e,onChange:t}){const[r,n]=g.useState(e),o=g.useRef(r),i=g.useRef(t);return Gh(()=>{i.current=t},[t]),g.useEffect(()=>{var s;o.current!==r&&((s=i.current)==null||s.call(i,r),o.current=r)},[r,o]),[r,n,i]}function qh(e){return typeof e=="function"}function Xh(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ba=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Jh="VisuallyHidden",Ha=g.forwardRef((e,t)=>c.jsx(we.span,{...e,ref:t,style:{...Ba,...e.style}}));Ha.displayName=Jh;var Zh=Ha,Qh=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},er=new WeakMap,_n=new WeakMap,Mn={},qo=0,Va=function(e){return e&&(e.host||Va(e.parentNode))},em=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Va(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},tm=function(e,t,r,n){var o=em(t,Array.isArray(e)?e:[e]);Mn[r]||(Mn[r]=new WeakMap);var i=Mn[r],s=[],a=new Set,l=new Set(o),d=function(f){!f||a.has(f)||(a.add(f),d(f.parentNode))};o.forEach(d);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))u(h);else try{var p=h.getAttribute(n),w=p!==null&&p!=="false",m=(er.get(h)||0)+1,v=(i.get(h)||0)+1;er.set(h,m),i.set(h,v),s.push(h),m===1&&w&&_n.set(h,!0),v===1&&h.setAttribute(r,"true"),w||h.setAttribute(n,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return u(t),a.clear(),qo++,function(){s.forEach(function(f){var h=er.get(f)-1,p=i.get(f)-1;er.set(f,h),i.set(f,p),h||(_n.has(f)||f.removeAttribute(n),_n.delete(f)),p||f.removeAttribute(r)}),qo--,qo||(er=new WeakMap,er=new WeakMap,_n=new WeakMap,Mn={})}},Ka=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Qh(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),tm(n,o,r,"aria-hidden")):function(){return null}},dt=function(){return dt=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},dt.apply(this,arguments)};function Ga(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function rm(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Rn="right-scroll-bar-position",Ln="width-before-scroll-bar",nm="with-scroll-bars-hidden",om="--removed-body-scroll-bar-size";function Xo(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function im(e,t){var r=b.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var sm=typeof window<"u"?g.useLayoutEffect:g.useEffect,Ya=new WeakMap;function am(e,t){var r=im(null,function(n){return e.forEach(function(o){return Xo(o,n)})});return sm(function(){var n=Ya.get(r);if(n){var o=new Set(n),i=new Set(e),s=r.current;o.forEach(function(a){i.has(a)||Xo(a,null)}),i.forEach(function(a){o.has(a)||Xo(a,s)})}Ya.set(r,e)},[e]),r}function lm(e){return e}function cm(e,t){t===void 0&&(t=lm);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var s=t(i,n);return r.push(s),function(){r=r.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(n=!0;r.length;){var s=r;r=[],s.forEach(i)}r={push:function(a){return i(a)},filter:function(){return r}}},assignMedium:function(i){n=!0;var s=[];if(r.length){var a=r;r=[],a.forEach(i),s=r}var l=function(){var u=s;s=[],u.forEach(i)},d=function(){return Promise.resolve().then(l)};d(),r={push:function(u){s.push(u),d()},filter:function(u){return s=s.filter(u),r}}}};return o}function dm(e){e===void 0&&(e={});var t=cm(null);return t.options=dt({async:!0,ssr:!1},e),t}var qa=function(e){var t=e.sideCar,r=Ga(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return g.createElement(n,dt({},r))};qa.isSideCarExport=!0;function um(e,t){return e.useMedium(t),qa}var Xa=dm(),Jo=function(){},$n=g.forwardRef(function(e,t){var r=g.useRef(null),n=g.useState({onScrollCapture:Jo,onWheelCapture:Jo,onTouchMoveCapture:Jo}),o=n[0],i=n[1],s=e.forwardProps,a=e.children,l=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,w=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,k=y===void 0?"div":y,x=e.gapMode,S=Ga(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,E=am([r,t]),j=dt(dt({},S),o);return g.createElement(g.Fragment,null,u&&g.createElement(C,{sideCar:Xa,removeScrollBar:d,shards:f,noRelative:p,noIsolation:w,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:r,gapMode:x}),s?g.cloneElement(g.Children.only(a),dt(dt({},j),{ref:E})):g.createElement(k,dt({},j,{className:l,ref:E}),a))});$n.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$n.classNames={fullWidth:Ln,zeroRight:Rn};var fm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pm(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fm();return t&&e.setAttribute("nonce",t),e}function hm(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mm(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gm=function(){var e=0,t=null;return{add:function(r){e==0&&(t=pm())&&(hm(t,r),mm(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bm=function(){var e=gm();return function(t,r){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Ja=function(){var e=bm(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},vm={left:0,top:0,right:0,gap:0},Zo=function(e){return parseInt(e||"",10)||0},xm=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Zo(r),Zo(n),Zo(o)]},wm=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vm;var t=xm(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},ym=Ja(),tr="data-scroll-locked",km=function(e,t,r,n){var o=e.left,i=e.top,s=e.right,a=e.gap;return r===void 0&&(r="margin"),`
187
+ .`.concat(nm,` {
214
188
  overflow: hidden `).concat(n,`;
215
189
  padding-right: `).concat(a,"px ").concat(n,`;
216
190
  }
217
- body[`).concat(Qt,`] {
191
+ body[`).concat(tr,`] {
218
192
  overflow: hidden `).concat(n,`;
219
193
  overscroll-behavior: contain;
220
194
  `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
@@ -227,7 +201,7 @@ React keys must be passed directly to JSX without using spread:
227
201
  `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),`
228
202
  }
229
203
 
230
- .`).concat(Mn,` {
204
+ .`).concat(Rn,` {
231
205
  right: `).concat(a,"px ").concat(n,`;
232
206
  }
233
207
 
@@ -235,7 +209,7 @@ React keys must be passed directly to JSX without using spread:
235
209
  margin-right: `).concat(a,"px ").concat(n,`;
236
210
  }
237
211
 
238
- .`).concat(Mn," .").concat(Mn,` {
212
+ .`).concat(Rn," .").concat(Rn,` {
239
213
  right: 0 `).concat(n,`;
240
214
  }
241
215
 
@@ -243,10 +217,10 @@ React keys must be passed directly to JSX without using spread:
243
217
  margin-right: 0 `).concat(n,`;
244
218
  }
245
219
 
246
- body[`).concat(Qt,`] {
247
- `).concat(am,": ").concat(a,`px;
220
+ body[`).concat(tr,`] {
221
+ `).concat(om,": ").concat(a,`px;
248
222
  }
249
- `)},el=function(){var e=parseInt(document.body.getAttribute(Qt)||"0",10);return isFinite(e)?e:0},Em=function(){E.useEffect(function(){return document.body.setAttribute(Qt,(el()+1).toString()),function(){var e=el()-1;e<=0?document.body.removeAttribute(Qt):document.body.setAttribute(Qt,e.toString())}},[])},Nm=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;Em();var i=E.useMemo(function(){return _m(o)},[o]);return E.createElement(Sm,{styles:Cm(i,!t,o,r?"":"!important")})},ei=!1;if(typeof window<"u")try{var Bn=Object.defineProperty({},"passive",{get:function(){return ei=!0,!0}});window.addEventListener("test",Bn,Bn),window.removeEventListener("test",Bn,Bn)}catch{ei=!1}var er=ei?{passive:!1}:!1,zm=function(e){return e.tagName==="TEXTAREA"},tl=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!zm(e)&&r[t]==="visible")},jm=function(e){return tl(e,"overflowY")},Am=function(e){return tl(e,"overflowX")},rl=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=nl(e,n);if(o){var i=ol(e,n),s=i[1],a=i[2];if(s>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Tm=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Om=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},nl=function(e,t){return e==="v"?jm(t):Am(t)},ol=function(e,t){return e==="v"?Tm(t):Om(t)},Im=function(e,t){return e==="h"&&t==="rtl"?-1:1},Pm=function(e,t,r,n,o){var i=Im(e,window.getComputedStyle(t).direction),s=i*n,a=r.target,l=t.contains(a),c=!1,d=s>0,f=0,m=0;do{if(!a)break;var p=ol(e,a),w=p[0],u=p[1],g=p[2],b=u-g-i*w;(w||b)&&nl(e,a)&&(f+=b,m+=w);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(f)<1||!d&&Math.abs(m)<1)&&(c=!0),c},Un=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},il=function(e){return[e.deltaX,e.deltaY]},sl=function(e){return e&&"current"in e?e.current:e},Dm=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Rm=function(e){return`
223
+ `)},Za=function(){var e=parseInt(document.body.getAttribute(tr)||"0",10);return isFinite(e)?e:0},Sm=function(){g.useEffect(function(){return document.body.setAttribute(tr,(Za()+1).toString()),function(){var e=Za()-1;e<=0?document.body.removeAttribute(tr):document.body.setAttribute(tr,e.toString())}},[])},Cm=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n;Sm();var i=g.useMemo(function(){return wm(o)},[o]);return g.createElement(ym,{styles:km(i,!t,o,r?"":"!important")})},Qo=!1;if(typeof window<"u")try{var Fn=Object.defineProperty({},"passive",{get:function(){return Qo=!0,!0}});window.addEventListener("test",Fn,Fn),window.removeEventListener("test",Fn,Fn)}catch{Qo=!1}var rr=Qo?{passive:!1}:!1,Em=function(e){return e.tagName==="TEXTAREA"},Qa=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Em(e)&&r[t]==="visible")},Nm=function(e){return Qa(e,"overflowY")},jm=function(e){return Qa(e,"overflowX")},el=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=tl(e,n);if(o){var i=rl(e,n),s=i[1],a=i[2];if(s>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Am=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Tm=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},tl=function(e,t){return e==="v"?Nm(t):jm(t)},rl=function(e,t){return e==="v"?Am(t):Tm(t)},zm=function(e,t){return e==="h"&&t==="rtl"?-1:1},Pm=function(e,t,r,n,o){var i=zm(e,window.getComputedStyle(t).direction),s=i*n,a=r.target,l=t.contains(a),d=!1,u=s>0,f=0,h=0;do{if(!a)break;var p=rl(e,a),w=p[0],m=p[1],v=p[2],y=m-v-i*w;(w||y)&&tl(e,a)&&(f+=y,h+=w);var k=a.parentNode;a=k&&k.nodeType===Node.DOCUMENT_FRAGMENT_NODE?k.host:k}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(f)<1||!u&&Math.abs(h)<1)&&(d=!0),d},Wn=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},nl=function(e){return[e.deltaX,e.deltaY]},ol=function(e){return e&&"current"in e?e.current:e},Om=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Im=function(e){return`
250
224
  .block-interactivity-`.concat(e,` {pointer-events: none;}
251
225
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
252
- `)},Mm=0,tr=[];function Lm(e){var t=E.useRef([]),r=E.useRef([0,0]),n=E.useRef(),o=E.useState(Mm++)[0],i=E.useState(Qa)[0],s=E.useRef(e);E.useEffect(function(){s.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var u=im([e.lockRef.current],(e.shards||[]).map(sl),!0).filter(Boolean);return u.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),u.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=E.useCallback(function(u,g){if("touches"in u&&u.touches.length===2||u.type==="wheel"&&u.ctrlKey)return!s.current.allowPinchZoom;var b=Un(u),v=r.current,k="deltaX"in u?u.deltaX:v[0]-b[0],_="deltaY"in u?u.deltaY:v[1]-b[1],S,O=u.target,z=Math.abs(k)>Math.abs(_)?"h":"v";if("touches"in u&&z==="h"&&O.type==="range")return!1;var I=window.getSelection(),D=I&&I.anchorNode,U=D?D===O||D.contains(O):!1;if(U)return!1;var H=rl(z,O);if(!H)return!0;if(H?S=z:(S=z==="v"?"h":"v",H=rl(z,O)),!H)return!1;if(!n.current&&"changedTouches"in u&&(k||_)&&(n.current=S),!S)return!0;var C=n.current||S;return Pm(C,g,u,C==="h"?k:_)},[]),l=E.useCallback(function(u){var g=u;if(!(!tr.length||tr[tr.length-1]!==i)){var b="deltaY"in g?il(g):Un(g),v=t.current.filter(function(S){return S.name===g.type&&(S.target===g.target||g.target===S.shadowParent)&&Dm(S.delta,b)})[0];if(v&&v.should){g.cancelable&&g.preventDefault();return}if(!v){var k=(s.current.shards||[]).map(sl).filter(Boolean).filter(function(S){return S.contains(g.target)}),_=k.length>0?a(g,k[0]):!s.current.noIsolation;_&&g.cancelable&&g.preventDefault()}}},[]),c=E.useCallback(function(u,g,b,v){var k={name:u,delta:g,target:b,should:v,shadowParent:Fm(b)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(_){return _!==k})},1)},[]),d=E.useCallback(function(u){r.current=Un(u),n.current=void 0},[]),f=E.useCallback(function(u){c(u.type,il(u),u.target,a(u,e.lockRef.current))},[]),m=E.useCallback(function(u){c(u.type,Un(u),u.target,a(u,e.lockRef.current))},[]);E.useEffect(function(){return tr.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",l,er),document.addEventListener("touchmove",l,er),document.addEventListener("touchstart",d,er),function(){tr=tr.filter(function(u){return u!==i}),document.removeEventListener("wheel",l,er),document.removeEventListener("touchmove",l,er),document.removeEventListener("touchstart",d,er)}},[]);var p=e.removeScrollBar,w=e.inert;return E.createElement(E.Fragment,null,w?E.createElement(i,{styles:Rm(o)}):null,p?E.createElement(Nm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Fm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Bm=hm(Ja,Lm);var ti=E.forwardRef(function(e,t){return E.createElement(Fn,at({},e,{ref:t,sideCar:Bm}))});ti.classNames=Fn.classNames;var Um=[" ","Enter","ArrowUp","ArrowDown"],$m=[" ","Enter"],Pt="Select",[$n,Wn,Wm]=ap(Pt),[rr]=Nr(Pt,[Wm,Xt]),Hn=Xt(),[Hm,_t]=rr(Pt),[Vm,Zm]=rr(Pt),al=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:f,disabled:m,required:p,form:w}=e,u=Hn(t),[g,b]=E.useState(null),[v,k]=E.useState(null),[_,S]=E.useState(!1),O=cp(c),[z,I]=Pn({prop:n,defaultProp:o??!1,onChange:i,caller:Pt}),[D,U]=Pn({prop:s,defaultProp:a,onChange:l,caller:Pt}),H=E.useRef(null),C=g?w||!!g.closest("form"):!0,[M,y]=E.useState(new Set),L=Array.from(M).map(Q=>Q.props.value).join(";");return h.jsx(Go,{...u,children:h.jsxs(Hm,{required:p,scope:t,trigger:g,onTriggerChange:b,valueNode:v,onValueNodeChange:k,valueNodeHasChildren:_,onValueNodeHasChildrenChange:S,contentId:zr(),value:D,onValueChange:U,open:z,onOpenChange:I,dir:O,triggerPointerDownPosRef:H,disabled:m,children:[h.jsx($n.Provider,{scope:t,children:h.jsx(Vm,{scope:e.__scopeSelect,onNativeOptionAdd:E.useCallback(Q=>{y(F=>new Set(F).add(Q))},[]),onNativeOptionRemove:E.useCallback(Q=>{y(F=>{const $=new Set(F);return $.delete(Q),$})},[]),children:r})}),C?h.jsxs(Nl,{"aria-hidden":!0,required:p,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:Q=>U(Q.target.value),disabled:m,form:w,children:[D===void 0?h.jsx("option",{value:""}):null,Array.from(M)]},L):null]})})};al.displayName=Pt;var ll="SelectTrigger",cl=E.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Hn(r),s=_t(ll,r),a=s.disabled||n,l=Oe(t,s.onTriggerChange),c=Wn(r),d=E.useRef("touch"),[f,m,p]=jl(u=>{const g=c().filter(k=>!k.disabled),b=g.find(k=>k.value===s.value),v=Al(g,u,b);v!==void 0&&s.onValueChange(v.value)}),w=u=>{a||(s.onOpenChange(!0),p()),u&&(s.triggerPointerDownPosRef.current={x:Math.round(u.pageX),y:Math.round(u.pageY)})};return h.jsx(On,{asChild:!0,...i,children:h.jsx(Te.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":zl(s.value)?"":void 0,...o,ref:l,onClick:ze(o.onClick,u=>{u.currentTarget.focus(),d.current!=="mouse"&&w(u)}),onPointerDown:ze(o.onPointerDown,u=>{d.current=u.pointerType;const g=u.target;g.hasPointerCapture(u.pointerId)&&g.releasePointerCapture(u.pointerId),u.button===0&&u.ctrlKey===!1&&u.pointerType==="mouse"&&(w(u),u.preventDefault())}),onKeyDown:ze(o.onKeyDown,u=>{const g=f.current!=="";!(u.ctrlKey||u.altKey||u.metaKey)&&u.key.length===1&&m(u.key),!(g&&u.key===" ")&&Um.includes(u.key)&&(w(),u.preventDefault())})})})});cl.displayName=ll;var dl="SelectValue",ul=E.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...a}=e,l=_t(dl,r),{onValueNodeHasChildrenChange:c}=l,d=i!==void 0,f=Oe(t,l.onValueNodeChange);return Ue(()=>{c(d)},[c,d]),h.jsx(Te.span,{...a,ref:f,style:{pointerEvents:"none"},children:zl(l.value)?h.jsx(h.Fragment,{children:s}):i})});ul.displayName=dl;var Gm="SelectIcon",fl=E.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return h.jsx(Te.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});fl.displayName=Gm;var Km="SelectPortal",pl=e=>h.jsx(In,{asChild:!0,...e});pl.displayName=Km;var Dt="SelectContent",hl=E.forwardRef((e,t)=>{const r=_t(Dt,e.__scopeSelect),[n,o]=E.useState();if(Ue(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Wr.createPortal(h.jsx(ml,{scope:e.__scopeSelect,children:h.jsx($n.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),i):null}return h.jsx(gl,{...e,ref:t})});hl.displayName=Dt;var rt=10,[ml,St]=rr(Dt),Ym="SelectContentImpl",qm=Zt("SelectContent.RemoveScroll"),gl=E.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:w,hideWhenDetached:u,avoidCollisions:g,...b}=e,v=_t(Dt,r),[k,_]=E.useState(null),[S,O]=E.useState(null),z=Oe(t,q=>_(q)),[I,D]=E.useState(null),[U,H]=E.useState(null),C=Wn(r),[M,y]=E.useState(!1),L=E.useRef(!1);E.useEffect(()=>{if(k)return Ka(k)},[k]),sa();const Q=E.useCallback(q=>{const[ie,...ue]=C().map(ve=>ve.ref.current),[ae]=ue.slice(-1),pe=document.activeElement;for(const ve of q)if(ve===pe||(ve==null||ve.scrollIntoView({block:"nearest"}),ve===ie&&S&&(S.scrollTop=0),ve===ae&&S&&(S.scrollTop=S.scrollHeight),ve==null||ve.focus(),document.activeElement!==pe))return},[C,S]),F=E.useCallback(()=>Q([I,k]),[Q,I,k]);E.useEffect(()=>{M&&F()},[M,F]);const{onOpenChange:$,triggerPointerDownPosRef:V}=v;E.useEffect(()=>{if(k){let q={x:0,y:0};const ie=ae=>{var pe,ve;q={x:Math.abs(Math.round(ae.pageX)-(((pe=V.current)==null?void 0:pe.x)??0)),y:Math.abs(Math.round(ae.pageY)-(((ve=V.current)==null?void 0:ve.y)??0))}},ue=ae=>{q.x<=10&&q.y<=10?ae.preventDefault():k.contains(ae.target)||$(!1),document.removeEventListener("pointermove",ie),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",ie),document.addEventListener("pointerup",ue,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ie),document.removeEventListener("pointerup",ue,{capture:!0})}}},[k,$,V]),E.useEffect(()=>{const q=()=>$(!1);return window.addEventListener("blur",q),window.addEventListener("resize",q),()=>{window.removeEventListener("blur",q),window.removeEventListener("resize",q)}},[$]);const[re,A]=jl(q=>{const ie=C().filter(pe=>!pe.disabled),ue=ie.find(pe=>pe.ref.current===document.activeElement),ae=Al(ie,q,ue);ae&&setTimeout(()=>ae.ref.current.focus())}),P=E.useCallback((q,ie,ue)=>{const ae=!L.current&&!ue;(v.value!==void 0&&v.value===ie||ae)&&(D(q),ae&&(L.current=!0))},[v.value]),J=E.useCallback(()=>k==null?void 0:k.focus(),[k]),G=E.useCallback((q,ie,ue)=>{const ae=!L.current&&!ue;(v.value!==void 0&&v.value===ie||ae)&&H(q)},[v.value]),te=n==="popper"?ri:bl,ce=te===ri?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:m,collisionPadding:p,sticky:w,hideWhenDetached:u,avoidCollisions:g}:{};return h.jsx(ml,{scope:r,content:k,viewport:S,onViewportChange:O,itemRefCallback:P,selectedItem:I,onItemLeave:J,itemTextRefCallback:G,focusSelectedItem:F,selectedItemText:U,position:n,isPositioned:M,searchRef:re,children:h.jsx(ti,{as:qm,allowPinchZoom:!0,children:h.jsx(Io,{asChild:!0,trapped:v.open,onMountAutoFocus:q=>{q.preventDefault()},onUnmountAutoFocus:ze(o,q=>{var ie;(ie=v.trigger)==null||ie.focus({preventScroll:!0}),q.preventDefault()}),children:h.jsx(yn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:q=>q.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:h.jsx(te,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:q=>q.preventDefault(),...b,...ce,onPlaced:()=>y(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:ze(b.onKeyDown,q=>{const ie=q.ctrlKey||q.altKey||q.metaKey;if(q.key==="Tab"&&q.preventDefault(),!ie&&q.key.length===1&&A(q.key),["ArrowUp","ArrowDown","Home","End"].includes(q.key)){let ae=C().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(q.key)&&(ae=ae.slice().reverse()),["ArrowUp","ArrowDown"].includes(q.key)){const pe=q.target,ve=ae.indexOf(pe);ae=ae.slice(ve+1)}setTimeout(()=>Q(ae)),q.preventDefault()}})})})})})})});gl.displayName=Ym;var Xm="SelectItemAlignedPosition",bl=E.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=_t(Dt,r),s=St(Dt,r),[a,l]=E.useState(null),[c,d]=E.useState(null),f=Oe(t,z=>d(z)),m=Wn(r),p=E.useRef(!1),w=E.useRef(!0),{viewport:u,selectedItem:g,selectedItemText:b,focusSelectedItem:v}=s,k=E.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&u&&g&&b){const z=i.trigger.getBoundingClientRect(),I=c.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),U=b.getBoundingClientRect();if(i.dir!=="rtl"){const pe=U.left-I.left,ve=D.left-pe,_e=z.left-ve,x=z.width+_e,K=Math.max(x,I.width),W=window.innerWidth-rt,T=Js(ve,[rt,Math.max(rt,W-K)]);a.style.minWidth=x+"px",a.style.left=T+"px"}else{const pe=I.right-U.right,ve=window.innerWidth-D.right-pe,_e=window.innerWidth-z.right-ve,x=z.width+_e,K=Math.max(x,I.width),W=window.innerWidth-rt,T=Js(ve,[rt,Math.max(rt,W-K)]);a.style.minWidth=x+"px",a.style.right=T+"px"}const H=m(),C=window.innerHeight-rt*2,M=u.scrollHeight,y=window.getComputedStyle(c),L=parseInt(y.borderTopWidth,10),Q=parseInt(y.paddingTop,10),F=parseInt(y.borderBottomWidth,10),$=parseInt(y.paddingBottom,10),V=L+Q+M+$+F,re=Math.min(g.offsetHeight*5,V),A=window.getComputedStyle(u),P=parseInt(A.paddingTop,10),J=parseInt(A.paddingBottom,10),G=z.top+z.height/2-rt,te=C-G,ce=g.offsetHeight/2,q=g.offsetTop+ce,ie=L+Q+q,ue=V-ie;if(ie<=G){const pe=H.length>0&&g===H[H.length-1].ref.current;a.style.bottom="0px";const ve=c.clientHeight-u.offsetTop-u.offsetHeight,_e=Math.max(te,ce+(pe?J:0)+ve+F),x=ie+_e;a.style.height=x+"px"}else{const pe=H.length>0&&g===H[0].ref.current;a.style.top="0px";const _e=Math.max(G,L+u.offsetTop+(pe?P:0)+ce)+ue;a.style.height=_e+"px",u.scrollTop=ie-G+u.offsetTop}a.style.margin=`${rt}px 0`,a.style.minHeight=re+"px",a.style.maxHeight=C+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[m,i.trigger,i.valueNode,a,c,u,g,b,i.dir,n]);Ue(()=>k(),[k]);const[_,S]=E.useState();Ue(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const O=E.useCallback(z=>{z&&w.current===!0&&(k(),v==null||v(),w.current=!1)},[k,v]);return h.jsx(Qm,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:O,children:h.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:h.jsx(Te.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});bl.displayName=Xm;var Jm="SelectPopperPosition",ri=E.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=rt,...i}=e,s=Hn(r);return h.jsx(Ko,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ri.displayName=Jm;var[Qm,ni]=rr(Dt,{}),oi="SelectViewport",vl=E.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=St(oi,r),s=ni(oi,r),a=Oe(t,i.onViewportChange),l=E.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),h.jsx($n.Slot,{scope:r,children:h.jsx(Te.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ze(o.onScroll,c=>{const d=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=s;if(m!=null&&m.current&&f){const p=Math.abs(l.current-d.scrollTop);if(p>0){const w=window.innerHeight-rt*2,u=parseFloat(f.style.minHeight),g=parseFloat(f.style.height),b=Math.max(u,g);if(b<w){const v=b+p,k=Math.min(w,v),_=v-k;f.style.height=k+"px",f.style.bottom==="0px"&&(d.scrollTop=_>0?_:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});vl.displayName=oi;var xl="SelectGroup",[eg,tg]=rr(xl),rg=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=zr();return h.jsx(eg,{scope:r,id:o,children:h.jsx(Te.div,{role:"group","aria-labelledby":o,...n,ref:t})})});rg.displayName=xl;var wl="SelectLabel",ng=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=tg(wl,r);return h.jsx(Te.div,{id:o.id,...n,ref:t})});ng.displayName=wl;var Vn="SelectItem",[og,yl]=rr(Vn),kl=E.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,a=_t(Vn,r),l=St(Vn,r),c=a.value===n,[d,f]=E.useState(i??""),[m,p]=E.useState(!1),w=Oe(t,v=>{var k;return(k=l.itemRefCallback)==null?void 0:k.call(l,v,n,o)}),u=zr(),g=E.useRef("touch"),b=()=>{o||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(og,{scope:r,value:n,disabled:o,textId:u,isSelected:c,onItemTextChange:E.useCallback(v=>{f(k=>k||((v==null?void 0:v.textContent)??"").trim())},[]),children:h.jsx($n.ItemSlot,{scope:r,value:n,disabled:o,textValue:d,children:h.jsx(Te.div,{role:"option","aria-labelledby":u,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:w,onFocus:ze(s.onFocus,()=>p(!0)),onBlur:ze(s.onBlur,()=>p(!1)),onClick:ze(s.onClick,()=>{g.current!=="mouse"&&b()}),onPointerUp:ze(s.onPointerUp,()=>{g.current==="mouse"&&b()}),onPointerDown:ze(s.onPointerDown,v=>{g.current=v.pointerType}),onPointerMove:ze(s.onPointerMove,v=>{var k;g.current=v.pointerType,o?(k=l.onItemLeave)==null||k.call(l):g.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ze(s.onPointerLeave,v=>{var k;v.currentTarget===document.activeElement&&((k=l.onItemLeave)==null||k.call(l))}),onKeyDown:ze(s.onKeyDown,v=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&v.key===" "||($m.includes(v.key)&&b(),v.key===" "&&v.preventDefault())})})})})});kl.displayName=Vn;var Tr="SelectItemText",_l=E.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=_t(Tr,r),a=St(Tr,r),l=yl(Tr,r),c=Zm(Tr,r),[d,f]=E.useState(null),m=Oe(t,b=>f(b),l.onItemTextChange,b=>{var v;return(v=a.itemTextRefCallback)==null?void 0:v.call(a,b,l.value,l.disabled)}),p=d==null?void 0:d.textContent,w=E.useMemo(()=>h.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:u,onNativeOptionRemove:g}=c;return Ue(()=>(u(w),()=>g(w)),[u,g,w]),h.jsxs(h.Fragment,{children:[h.jsx(Te.span,{id:l.textId,...i,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Wr.createPortal(i.children,s.valueNode):null]})});_l.displayName=Tr;var Sl="SelectItemIndicator",Cl=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return yl(Sl,r).isSelected?h.jsx(Te.span,{"aria-hidden":!0,...n,ref:t}):null});Cl.displayName=Sl;var ii="SelectScrollUpButton",ig=E.forwardRef((e,t)=>{const r=St(ii,e.__scopeSelect),n=ni(ii,e.__scopeSelect),[o,i]=E.useState(!1),s=Oe(t,n.onScrollButtonChange);return Ue(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?h.jsx(El,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});ig.displayName=ii;var si="SelectScrollDownButton",sg=E.forwardRef((e,t)=>{const r=St(si,e.__scopeSelect),n=ni(si,e.__scopeSelect),[o,i]=E.useState(!1),s=Oe(t,n.onScrollButtonChange);return Ue(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<c;i(d)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?h.jsx(El,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});sg.displayName=si;var El=E.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=St("SelectScrollButton",r),s=E.useRef(null),a=Wn(r),l=E.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return E.useEffect(()=>()=>l(),[l]),Ue(()=>{var d;const c=a().find(f=>f.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),h.jsx(Te.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ze(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:ze(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:ze(o.onPointerLeave,()=>{l()})})}),ag="SelectSeparator",lg=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return h.jsx(Te.div,{"aria-hidden":!0,...n,ref:t})});lg.displayName=ag;var ai="SelectArrow",cg=E.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Hn(r),i=_t(ai,r),s=St(ai,r);return i.open&&s.position==="popper"?h.jsx(Yo,{...o,...n,ref:t}):null});cg.displayName=ai;var dg="SelectBubbleInput",Nl=E.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=E.useRef(null),i=Oe(n,o),s=Qh(t);return E.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&d){const f=new Event("change",{bubbles:!0});d.call(a,t),a.dispatchEvent(f)}},[s,t]),h.jsx(Te.select,{...r,style:{...Va,...r.style},ref:i,defaultValue:t})});Nl.displayName=dg;function zl(e){return e===""||e===void 0}function jl(e){const t=Ot(e),r=E.useRef(""),n=E.useRef(0),o=E.useCallback(s=>{const a=r.current+s;t(a),(function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=E.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return E.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function Al(e,t,r){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=ug(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==r));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function ug(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var fg=al,Tl=cl,pg=ul,hg=fl,mg=pl,Ol=hl,gg=vl,Il=kl,bg=_l,vg=Cl;const xg=fg,wg=pg,Pl=E.forwardRef(({className:e,children:t,...r},n)=>h.jsxs(Tl,{ref:n,className:ye("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-zinc-800 bg-black px-3 py-1.5 text-left text-xs font-medium text-white outline-none","hover:bg-zinc-900 focus-visible:ring-2 focus-visible:ring-blue-500/80 focus-visible:ring-inset focus-visible:border-zinc-600","disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:flex [&>span]:items-center [&>span]:gap-2",e),style:{boxShadow:"none",WebkitBoxShadow:"none",MozBoxShadow:"none"},...r,children:[t,h.jsx(hg,{asChild:!0,children:h.jsx(Xr,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));Pl.displayName=Tl.displayName;const Dl=E.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>h.jsx(mg,{children:h.jsx(Ol,{ref:o,className:ye("relative z-[9999] max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-zinc-800 bg-zinc-950 text-white shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:h.jsx(gg,{className:ye("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));Dl.displayName=Ol.displayName;const Rl=E.forwardRef(({className:e,children:t,...r},n)=>h.jsxs(Il,{ref:n,className:ye("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-xs outline-none","focus:bg-zinc-800 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(vg,{children:h.jsx(so,{className:"h-3 w-3",strokeWidth:2})})}),h.jsx(bg,{children:t})]}));Rl.displayName=Il.displayName;const Ml=E.createContext(null);function Ll(){const e=E.useContext(Ml);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function Fl({open:e,onOpenChange:t,children:r}){const[n,o]=E.useState(!1),i=e!==void 0,s=i?e:n,a=E.useCallback(c=>{i||o(c),t==null||t(c)},[i,t]),l=E.useMemo(()=>({open:s,onOpenChange:a}),[s,a]);return h.jsx(Ml.Provider,{value:l,children:r})}function yg({asChild:e,children:t}){const{onOpenChange:r}=Ll(),n=E.Children.only(t);return e&&E.isValidElement(n)?E.cloneElement(n,{onClick:o=>{var i,s;(s=(i=n.props).onClick)==null||s.call(i,o),r(!0)}}):h.jsx("button",{type:"button",onClick:()=>r(!0),children:t})}function Bl({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:o,onOpenChange:i}=Ll();if(E.useEffect(()=>{const a=l=>{l.key==="Escape"&&i(!1)};return o&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[o,i]),!o)return null;const s=a=>{a.preventDefault(),a.stopPropagation()};return mt.createPortal(h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-[9998] bg-black/60","aria-hidden":!0,onClick:()=>!r&&i(!1),onDragOver:s,onDrop:s}),h.jsx("div",{role:"dialog","aria-modal":!0,className:ye("fixed left-1/2 top-1/2 z-[9999] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border border-zinc-700 bg-zinc-900 p-4 shadow-xl",e),onClick:a=>a.stopPropagation(),...n,children:t})]}),document.body)}function Ul({className:e,...t}){return h.jsx("div",{className:ye("flex flex-col gap-1.5 pb-4",e),...t})}function kg({className:e,...t}){return h.jsx("div",{className:ye("flex justify-end gap-2 pt-4",e),...t})}function $l({className:e,...t}){return h.jsx("h2",{className:ye("text-sm font-semibold text-white",e),...t})}function Wl({className:e,...t}){return h.jsx("p",{className:ye("text-xs text-zinc-400",e),...t})}const Ze=E.forwardRef(({className:e,variant:t="default",size:r="default",asChild:n=!1,...o},i)=>{const s="inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0 cursor-pointer",a={default:"bg-primary text-primary-foreground shadow-lg shadow-primary/20 hover:bg-primary/90",outline:"border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",ghost:"text-zinc-500 hover:text-zinc-200 hover:bg-zinc-800",destructive:"bg-destructive/15 text-destructive hover:bg-destructive/25"},l={sm:"h-7 px-2.5 text-[11px]",default:"h-8 px-3 py-1.5 text-xs",lg:"h-9 px-5 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7","icon-xs":"h-6 w-6"},c=n?tp:"button";return h.jsx(c,{ref:i,type:"button",className:ye(s,a[t],l[r],e),...o})});Ze.displayName="Button";const _g=["library","upload","url"];function Sg({library:e,selectedId:t,onSelect:r}){const[n,o]=N.useState(""),[i,s]=N.useState("all"),a=["all",...new Set(e.flatMap(c=>c.tags??[]))],l=e.filter(c=>{const d=i==="all"||(c.tags??[]).includes(i),f=!n||(c.alt??"").toLowerCase().includes(n.toLowerCase());return d&&f});return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"relative",children:[h.jsx(Bd,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-600 pointer-events-none"}),h.jsx(zo,{value:n,onChange:c=>o(c.target.value),placeholder:"Cerca immagini...",className:"pl-9 h-8 text-xs bg-zinc-900/50 border-zinc-800"})]}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(c=>h.jsx("button",{type:"button",onClick:()=>s(c),className:ye("px-2.5 py-1 rounded text-[10px] font-medium border transition-colors",i===c?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-700 text-zinc-500 hover:border-zinc-600 hover:text-zinc-400"),children:c==="all"?"Tutte":c},c))}),l.length>0?h.jsx("div",{className:"grid grid-cols-3 gap-2.5 max-h-[45vh] overflow-y-auto",children:l.map(c=>{const d=t===c.id;return h.jsxs("button",{type:"button",onClick:()=>r(d?null:c.id),className:ye("group relative aspect-[4/3] rounded-lg overflow-hidden","ring-1 transition-all duration-150",d?"ring-blue-500 ring-2 ring-offset-1 ring-offset-zinc-900":"ring-zinc-800 hover:ring-zinc-600 hover:scale-[1.02]"),children:[h.jsx("img",{src:c.url,alt:c.alt,loading:"lazy",className:ye("w-full h-full object-cover transition-[filter] duration-150",d?"brightness-[0.6]":"brightness-[0.85] group-hover:brightness-100")}),h.jsx("div",{className:ye("absolute inset-x-0 bottom-0 px-2 py-1.5","bg-gradient-to-t from-black/70 to-transparent","opacity-0 group-hover:opacity-100 transition-opacity",d&&"opacity-100"),children:h.jsx("span",{className:"text-[10px] text-white font-medium leading-tight line-clamp-2",children:c.alt})}),d&&h.jsx("div",{className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-blue-600 flex items-center justify-center",children:h.jsx(so,{size:14,className:"text-white"})})]},c.id)})}):h.jsx("div",{className:"text-center py-12 text-zinc-600 text-xs",children:"Nessuna immagine in libreria. Configura assets.assetsManifest nel tenant (es. da public/assets)."})]})}function Cg({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,o]=N.useState(!1),i=N.useRef(null),s=N.useCallback(async d=>{if(fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"handleFile called",data:{fileName:d.name,hasOnAssetUpload:!!r},timestamp:Date.now(),hypothesisId:"H5"})}).catch(()=>{}),!d.type.startsWith("image/"))return;if(r){try{const m=await r(d);fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"onAssetUpload resolved",data:{url:m==null?void 0:m.slice(0,50)},timestamp:Date.now(),hypothesisId:"H2,H5"})}).catch(()=>{}),t({name:d.name,size:d.size,dataUrl:m})}catch{const m=new FileReader;m.onload=p=>{var w;t({name:d.name,size:d.size,dataUrl:(w=p.target)==null?void 0:w.result})},m.readAsDataURL(d)}return}const f=new FileReader;f.onload=m=>{var p;t({name:d.name,size:d.size,dataUrl:(p=m.target)==null?void 0:p.result})},f.readAsDataURL(d)},[t,r]),a=N.useCallback(d=>{var m,p;d.preventDefault(),d.stopPropagation(),o(!1);const f=(p=(m=d.dataTransfer)==null?void 0:m.files)==null?void 0:p[0];f&&s(f)},[s]),l=N.useCallback(d=>{d.preventDefault(),d.stopPropagation(),o(!0)},[]),c=N.useCallback(d=>{var m;const f=(m=d.target.files)==null?void 0:m[0];f&&s(f)},[s]);return h.jsxs("div",{onDragOver:l,onDragEnter:l,onDragLeave:d=>{d.preventDefault(),d.stopPropagation(),o(!1)},onDrop:a,onClick:()=>{var d;return!e&&((d=i.current)==null?void 0:d.click())},className:ye("rounded-xl border-2 border-dashed transition-all min-h-[240px]","flex flex-col items-center justify-center overflow-hidden cursor-pointer relative",n?"border-blue-500/50 bg-blue-500/[0.04]":e?"border-zinc-800 bg-transparent cursor-default":"border-zinc-800 bg-white/[0.01] hover:border-zinc-600 hover:bg-white/[0.02]"),children:[e?h.jsxs(h.Fragment,{children:[h.jsx("img",{src:e.dataUrl,alt:"Upload preview",className:"w-full max-h-[320px] object-contain"}),h.jsxs("div",{className:"absolute bottom-0 inset-x-0 bg-gradient-to-t from-black/80 to-transparent p-4 flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-xs font-medium text-white",children:e.name}),h.jsxs("p",{className:"text-[10px] text-zinc-400",children:[(e.size/1024).toFixed(1)," KB"]})]}),h.jsx(Ze,{type:"button",variant:"ghost",className:"text-zinc-400 hover:text-red-400 hover:bg-red-500/10 h-8 w-8 p-0",onClick:d=>{d.stopPropagation(),t(null)},children:h.jsx(Qr,{size:14})})]})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/10 flex items-center justify-center text-blue-500 mb-3",children:h.jsx(as,{size:22})}),h.jsx("p",{className:"text-sm font-medium text-white mb-1",children:"Trascina un'immagine qui"}),h.jsx("p",{className:"text-[11px] text-zinc-500 mb-3",children:"oppure clicca per selezionare un file"}),h.jsx("span",{className:"text-[10px] text-zinc-600 bg-white/[0.03] px-3 py-1 rounded",children:"PNG, JPG, WebP — max 5MB"})]}),h.jsx("input",{ref:i,type:"file",accept:"image/*",className:"hidden",onChange:c})]})}function Eg({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=N.useState(""),[o,i]=N.useState(!1),s=()=>{if(r.trim())try{new URL(r),t(r),i(!1)}catch{i(!0),t(null)}};return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx(Tt,{className:"block text-[10px] font-bold uppercase tracking-[0.08em] text-zinc-500 mb-1.5",children:"URL immagine"}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(zo,{value:r,onChange:a=>{n(a.target.value),i(!1)},onKeyDown:a=>a.key==="Enter"&&s(),placeholder:"https://images.unsplash.com/photo-...",className:ye("h-8 text-xs bg-zinc-900/50 border-zinc-800",o&&"border-red-500/50")}),h.jsx(Ze,{type:"button",variant:"outline",onClick:s,className:"shrink-0 h-8",children:"Anteprima"})]}),o&&h.jsx("p",{className:"text-[11px] text-red-400 mt-1.5",children:"URL non valido. Inserisci un URL completo (https://…)"})]}),e?h.jsxs("div",{className:"rounded-lg overflow-hidden ring-1 ring-zinc-800",children:[h.jsx("img",{src:e,alt:"URL preview",className:"w-full max-h-[320px] object-contain bg-black/30",onError:()=>{i(!0),t(null)}}),h.jsxs("div",{className:"px-3.5 py-2.5 bg-white/[0.02] border-t border-zinc-800 flex items-center gap-2",children:[h.jsx(so,{size:14,className:"text-emerald-400"}),h.jsx("span",{className:"text-[11px] text-zinc-500",children:"Immagine caricata correttamente"})]})]}):o?null:h.jsxs("div",{className:"flex flex-col items-center py-12 text-zinc-600",children:[h.jsx(is,{size:32,className:"mb-3 opacity-40"}),h.jsx("p",{className:"text-xs",children:"Incolla un URL e premi Anteprima per verificare"})]})]})}const Ng=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=fr(),o=(n==null?void 0:n.assetsManifest)??[],[i,s]=N.useState("library"),[a,l]=N.useState(null),[c,d]=N.useState(null),[f,m]=N.useState(null);N.useEffect(()=>{e&&(s("library"),l(null),d(null),m(null))},[e]),N.useEffect(()=>{if(!e||i!=="upload")return;const b=()=>{fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:beforeunload",message:"beforeunload fired",data:{},timestamp:Date.now(),hypothesisId:"H1"})}).catch(()=>{})};return window.addEventListener("beforeunload",b),()=>window.removeEventListener("beforeunload",b)},[e,i]),N.useEffect(()=>{if(!e||i!=="upload")return;const b=k=>{k.preventDefault()},v={capture:!0};return document.addEventListener("dragover",b,v),document.addEventListener("drop",b,v),window.addEventListener("dragover",b,v),window.addEventListener("drop",b,v),()=>{document.removeEventListener("dragover",b,v),document.removeEventListener("drop",b,v),window.removeEventListener("dragover",b,v),window.removeEventListener("drop",b,v)}},[e,i]);const p=i==="library"&&a!=null||i==="upload"&&c!=null||i==="url"&&f!=null,w=()=>{if(i==="library"&&a){const b=o.find(v=>v.id===a);b&&r({url:b.url,alt:b.alt})}else i==="upload"&&c?r({url:c.dataUrl,alt:c.name}):i==="url"&&f&&r({url:f,alt:""});setTimeout(()=>t(!1),0)},u=i==="library"&&a?"1 immagine selezionata":i==="upload"&&c?c.name:i==="url"&&f?"URL pronto":"Nessuna selezione",g=b=>{b.preventDefault(),b.stopPropagation()};return h.jsx(Fl,{open:e,onOpenChange:t,children:h.jsxs(Bl,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:i==="upload",onDragOver:g,onDrop:g,children:[h.jsxs(Ul,{className:"px-5 py-4 flex flex-row items-start justify-between gap-4 border-b border-zinc-800",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/15 text-blue-500",children:h.jsx(Jr,{size:18})}),h.jsxs("div",{children:[h.jsx($l,{children:"Image Picker"}),h.jsx(Wl,{children:"Scegli dalla libreria, carica dal disco o inserisci un link"})]})]}),h.jsx("button",{type:"button",onClick:()=>t(!1),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Chiudi",children:h.jsx(Ft,{size:18})})]}),h.jsx("div",{className:"flex border-b border-zinc-800",children:_g.map(b=>h.jsxs("button",{type:"button",onClick:()=>s(b),className:ye("flex items-center gap-2 px-4 py-3 text-xs font-medium border-b-2 transition-colors",i===b?"border-blue-500 text-blue-400":"border-transparent text-zinc-500 hover:text-zinc-300"),children:[b==="library"&&h.jsx(Jr,{size:14}),b==="upload"&&h.jsx(as,{size:14}),b==="url"&&h.jsx(is,{size:14}),b==="library"?"Libreria":b==="upload"?"Upload":"URL"]},b))}),h.jsxs("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:[i==="library"&&h.jsx(Sg,{library:o,selectedId:a,onSelect:l}),i==="upload"&&h.jsx(Cg,{preview:c,onPreviewChange:d,onAssetUpload:n==null?void 0:n.onAssetUpload}),i==="url"&&h.jsx(Eg,{urlPreview:f,onUrlPreviewChange:m})]}),h.jsxs(kg,{className:"px-5 py-4 border-t border-zinc-800 flex-row justify-between",children:[h.jsx("span",{className:"text-[10px] uppercase tracking-[0.05em] text-zinc-600",children:u}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Ze,{type:"button",variant:"outline",size:"sm",onClick:()=>t(!1),children:"Annulla"}),h.jsx(Ze,{type:"button",size:"sm",disabled:!p,onClick:w,className:ye(!p&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},Hl=(e,t="default")=>{if(e.startsWith("http")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/assets/"))return e;if(e.startsWith("assets/"))return`/${e}`;if(e.startsWith("/uploaded-assets/"))return e;if(!/\.(jpg|jpeg|png|gif|svg|pdf|webp|mp4|webm|ogg)$/i.test(e))return e.startsWith("/")?e:`/${e}`;const n=e.replace(/^\//,"");return`/assets/${t}/${n}`},zg=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:o="default"}=fr(),[i,s]=N.useState(!1),[a,l]=N.useState(!1),c=!!(e!=null&&e.url),d=e!=null&&e.url?Hl(e.url,o):"",f=p=>{t(p),s(!1)},m=p=>{p.stopPropagation(),t({url:"",alt:""})};return h.jsxs("div",{className:ye("space-y-1.5",n),children:[h.jsx(Tt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:r}),c?h.jsxs("div",{role:"button",tabIndex:0,onClick:()=>s(!0),onKeyDown:p=>p.key==="Enter"&&s(!0),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:ye("relative rounded-lg overflow-hidden cursor-pointer","ring-1 ring-zinc-800 transition-all",a&&"ring-blue-500/40"),children:[h.jsx("img",{src:d,alt:(e==null?void 0:e.alt)??"",className:"w-full h-40 object-cover block",onError:p=>{p.target.style.display="none"}}),h.jsx("div",{className:ye("absolute inset-0 flex items-center justify-center gap-2 transition-all duration-150",a?"bg-black/50":"bg-black/0"),children:a&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-center gap-1.5 bg-white/15 backdrop-blur-md rounded-lg px-3.5 py-2 text-white text-xs font-medium",children:[h.jsx(Fd,{size:13}),h.jsx("span",{children:"Cambia"})]}),h.jsx(Ze,{type:"button",variant:"ghost",className:"h-8 w-8 p-0 bg-red-500/15 backdrop-blur-md text-red-300 hover:text-red-200 hover:bg-red-500/25",onClick:m,children:h.jsx(Qr,{size:13})})]})}),h.jsx("div",{className:"px-2.5 py-1.5 bg-black/50 text-[10px] text-zinc-500 truncate",children:((e==null?void 0:e.url)??"").length>50?"…"+((e==null?void 0:e.url)??"").slice(-47):(e==null?void 0:e.url)??""})]}):h.jsxs("button",{type:"button",onClick:()=>s(!0),className:ye("w-full rounded-lg border-2 border-dashed border-zinc-800 py-7","flex flex-col items-center gap-2","bg-white/[0.01] transition-all","hover:border-blue-500/30 hover:bg-blue-500/[0.03]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"),children:[h.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-500/10 flex items-center justify-center text-blue-500",children:h.jsx(Jr,{size:18})}),h.jsx("span",{className:"text-xs text-zinc-400 font-medium",children:"Clicca per aggiungere un'immagine"}),h.jsx("span",{className:"text-[10px] text-zinc-600",children:"Libreria · Upload · URL"})]}),h.jsx(Ng,{open:i,onOpenChange:s,onSelect:f})]})},Vl=[{name:"layers",Icon:lo},{name:"github",Icon:Md},{name:"arrow-right",Icon:jd},{name:"box",Icon:Td},{name:"terminal",Icon:Hd},{name:"chevron-right",Icon:Od},{name:"menu",Icon:Ld},{name:"x",Icon:Ft},{name:"sparkles",Icon:$d},{name:"zap",Icon:Zd}],Zn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),nr={"ui:text":({label:e,value:t,onChange:r})=>h.jsxs("div",{className:"grid w-full items-center gap-2 mb-4",children:[h.jsx(Tt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Zn(e)}),h.jsx(zo,{type:"text",className:"h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:textarea":({label:e,value:t,onChange:r})=>h.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[h.jsx(Tt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Zn(e)}),h.jsx(Jf,{className:"min-h-[96px] text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600 resize-none",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:select":({label:e,value:t,onChange:r,options:n=[]})=>h.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[h.jsx(Tt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Zn(e)}),h.jsxs(xg,{value:t||"",onValueChange:r,children:[h.jsx(Pl,{className:"w-full h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus:ring-blue-600",children:h.jsx(wg,{placeholder:"Select..."})}),h.jsx(Dl,{className:"dark",children:n.map(o=>h.jsx(Rl,{value:o,className:"text-[13px]",children:o},o))})]})]}),"ui:checkbox":({label:e,value:t,onChange:r})=>h.jsxs("div",{className:"flex items-center space-x-2 mb-4 p-2.5 rounded border border-zinc-700/60 bg-zinc-900/20",children:[h.jsx(Qf,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),h.jsx(Tt,{htmlFor:e,className:"text-[13px] font-medium cursor-pointer select-none text-zinc-200",children:Zn(e)})]}),"ui:image-picker":({label:e,value:t,onChange:r})=>{const n=t!=null&&typeof t=="object"&&"url"in t?{url:String(t.url??""),alt:String(t.alt??"")}:{url:typeof t=="string"?t:"",alt:""},o=i=>{r(i)};return h.jsx("div",{className:"mb-4",children:h.jsx(zg,{label:e,value:n,onChange:o})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,o]=N.useState(!1),i=Vl.find(s=>s.name===(t||""));return h.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[h.jsx(Tt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),h.jsxs(Fl,{open:n,onOpenChange:o,children:[h.jsx(yg,{asChild:!0,children:h.jsx(Ze,{variant:"outline",className:"w-full h-9 rounded-md border border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 flex items-center gap-2 text-left",children:i?h.jsxs(h.Fragment,{children:[h.jsx(i.Icon,{size:16,className:"text-zinc-400 shrink-0"}),h.jsx("span",{className:"text-[11px] text-zinc-300 capitalize truncate",children:i.name})]}):h.jsxs(h.Fragment,{children:[h.jsx(Jr,{size:16,className:"text-zinc-500 shrink-0"}),h.jsx("span",{className:"text-[11px] text-zinc-500",children:"Choose icon..."})]})})}),h.jsxs(Bl,{className:"sm:max-w-[280px] p-4",children:[h.jsxs(Ul,{children:[h.jsx($l,{className:"text-sm",children:"Choose icon"}),h.jsx(Wl,{className:"text-xs",children:"Click an icon to select it."})]}),h.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:Vl.map(({name:s,Icon:a})=>h.jsx("button",{type:"button",onClick:()=>{r(s),o(!1)},className:ye("flex items-center justify-center w-10 h-10 rounded-md border transition-colors",t===s?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 text-zinc-400 hover:text-zinc-200"),title:s,children:h.jsx(a,{size:20})},s))})]})]})]})}},li=e=>{if(e instanceof Pe.z.ZodOptional||e instanceof Pe.z.ZodDefault)return li(e._def.innerType);if(e instanceof Pe.z.ZodObject){const t={id:crypto.randomUUID()};for(const r in e.shape)r!=="id"&&(t[r]=li(e.shape[r]));return t}return e instanceof Pe.z.ZodArray?[]:e instanceof Pe.z.ZodString?"":e instanceof Pe.z.ZodNumber?0:e instanceof Pe.z.ZodBoolean?!1:e instanceof Pe.z.ZodEnum?e._def.values[0]:null},Gn=e=>e instanceof Pe.z.ZodOptional||e instanceof Pe.z.ZodDefault||e instanceof Pe.z.ZodNullable?Gn(e._def.innerType):e,Zl=e=>{var n;const t=e;if(typeof e.description=="string"&&e.description.length>0)return e.description;if(typeof((n=t._def)==null?void 0:n.description)=="string"&&t._def.description.length>0)return t._def.description;const r=Gn(e);return r!==e?Zl(r):null},Kn=(e,t)=>e&&!t?"opacity-10":"opacity-100",or=(e,t)=>e!=null&&t.toLowerCase()===e.toLowerCase(),ci=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),Or=({schema:e,data:t,onChange:r,keys:n,expandedItemPath:o,onSidebarExpandedItemChange:i})=>{const s=e.shape,a=n!=null?Object.keys(s).filter(f=>n.includes(f)):Object.keys(s),l=o==null?void 0:o[0],c=(l==null?void 0:l.fieldKey)??null,d=c!=null;return h.jsx("div",{className:"space-y-4",children:a.map(f=>{const m=s[f];if(!m)return null;const p=Gn(m),w=Zl(m)||"ui:text",u=t[f];if(w==="ui:editorial-markdown")return null;if(w==="ui:image-picker"&&p instanceof Pe.z.ZodObject){const _=or(c,f),S=nr["ui:image-picker"]||nr["ui:text"];return h.jsx("div",{className:`transition-opacity duration-200 ${Kn(d,_)}`,..._?{"data-jp-focused-field":f}:{},children:h.jsx(S,{label:f,value:u,onChange:O=>r({...t,[f]:O})})},f)}if(p instanceof Pe.z.ZodObject){const _=u||{},S=or(c,f);return h.jsxs("div",{className:`group/obj mb-6 p-4 border border-zinc-800 rounded-lg bg-zinc-900/20 hover:border-zinc-700 transition-[border-color,opacity] duration-200 ${Kn(d,S)}`,...S?{"data-jp-focused-field":f}:{},children:[h.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[h.jsx("div",{className:"w-1 h-3 bg-blue-500 rounded-full"}),h.jsx("h4",{className:"text-[11px] font-semibold text-zinc-300 tracking-[0.02em]",children:ci(f)})]}),h.jsx(Or,{schema:p,data:_,onChange:O=>r({...t,[f]:O}),expandedItemPath:o&&or(l==null?void 0:l.fieldKey,f)?o.slice(1):void 0})]},f)}if(p instanceof Pe.z.ZodArray){const _=Array.isArray(u)?u:[],S=Gn(p.element),O=(U,H)=>{if(H<0||H>=_.length)return;const C=[..._],[M]=C.splice(U,1);C.splice(H,0,M),r({...t,[f]:C})},z=or(c,f),D=or(l==null?void 0:l.fieldKey,f)?l==null?void 0:l.itemId:void 0;return h.jsxs("div",{className:`mb-8 transition-opacity duration-200 ${Kn(d,z)}`,...z?{"data-jp-focused-field":f}:{},children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsxs("label",{className:"text-[12px] font-semibold text-zinc-300 tracking-[0.01em]",children:[ci(f)," (",_.length,")"]}),h.jsxs("button",{type:"button",onClick:()=>{const U=li(S);r({...t,[f]:[..._,U]})},className:"flex items-center gap-1 px-2.5 py-1.5 bg-blue-600/10 hover:bg-blue-600/20 text-blue-400 rounded text-[11px] font-semibold transition-colors",children:[h.jsx(co,{size:12})," Add Item"]})]}),h.jsx("div",{className:"space-y-2",children:_.map((U,H)=>{const C=U,M=C.id||`legacy-${H}`,y=(typeof C.title=="string"?C.title:null)||(typeof C.label=="string"?C.label:null)||(typeof C.name=="string"?C.name:null)||(typeof C.content=="string"?C.content:null)||(typeof C.text=="string"?C.text:null)||`${ci(f)} #${H+1}`,L=D,Q=String(C.id??M),F=L!=null&&String(L)===Q,$=F&&o&&o.length>1?o.slice(1):void 0,V=d&&z&&L!=null&&!F;return h.jsx(jg,{itemId:Q,openItemId:L!=null?String(L):void 0,isFaded:V,index:H,isFirst:H===0,isLast:H===_.length-1,label:y,onExpandedChange:i?re=>i(re?{fieldKey:f,itemId:Q}:null):void 0,onRemove:()=>{const re=_.filter((A,P)=>P!==H);r({...t,[f]:re})},onMoveUp:()=>O(H,H-1),onMoveDown:()=>O(H,H+1),children:S instanceof Pe.z.ZodObject?h.jsx(Or,{schema:S,data:C||{},expandedItemPath:$,onChange:re=>{const A=[..._];A[H]=re,r({...t,[f]:A})}}):h.jsx("div",{className:"text-[10px] text-red-400",children:"Primitive arrays not supported."})},M)})})]},f)}const g=w in nr?w:"ui:text",b=nr[g]||nr["ui:text"],v=p instanceof Pe.z.ZodEnum?p._def.values:void 0,k=or(c,f);return h.jsx("div",{className:`transition-opacity duration-200 ${Kn(d,k)}`,...k?{"data-jp-focused-field":f}:{},children:h.jsx(b,{label:f,value:u,options:v,onChange:_=>r({...t,[f]:_})})},f)})})},jg=({itemId:e,openItemId:t,isFaded:r=!1,label:n,onExpandedChange:o,onRemove:i,onMoveUp:s,onMoveDown:a,isFirst:l,isLast:c,children:d})=>{const f=t!=null&&String(t)===String(e),[m,p]=N.useState(f);N.useEffect(()=>{t!=null&&(f&&!m&&p(!0),!f&&m&&p(!1))},[t,f,m]);const w=()=>{const g=!m;p(g),o==null||o(g)},u=f&&m;return h.jsxs("div",{className:`border border-zinc-800 rounded-md bg-zinc-900/40 overflow-hidden transition-opacity duration-200 ${r?"opacity-10":"opacity-100"}`,...u?{"data-jp-expanded-item":e}:{},children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900/60",children:[h.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:h.jsxs("button",{type:"button",onClick:w,className:"flex items-center gap-2 text-[12px] font-semibold text-zinc-200 tracking-[0.01em] truncate",children:[m?h.jsx(ao,{size:12,className:"shrink-0"}):h.jsx(Xr,{size:12,className:"shrink-0"}),h.jsx("span",{className:"truncate",children:n})]})}),h.jsxs("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[h.jsx("button",{type:"button",disabled:l,onClick:s,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:h.jsx(Ad,{size:12})}),h.jsx("button",{type:"button",disabled:c,onClick:a,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:h.jsx(zd,{size:12})}),h.jsx("div",{className:"w-px h-3 bg-zinc-800 mx-1"}),h.jsx("button",{type:"button",onClick:i,className:"text-zinc-600 hover:text-red-500 transition-colors p-1",children:h.jsx(Qr,{size:12})})]})]}),m&&h.jsx("div",{className:"p-4 border-t border-zinc-800 bg-black/20",children:d})]})};function Ag(e,t){return E.useReducer((r,n)=>t[r][n]??r,e)}var Ir=e=>{const{present:t,children:r}=e,n=Tg(t),o=typeof r=="function"?r({present:n.isPresent}):E.Children.only(r),i=Oe(n.ref,Og(o));return typeof r=="function"||n.isPresent?E.cloneElement(o,{ref:i}):null};Ir.displayName="Presence";function Tg(e){const[t,r]=E.useState(),n=E.useRef(null),o=E.useRef(e),i=E.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Ag(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const c=Yn(n.current);i.current=a==="mounted"?c:"none"},[a]),Ue(()=>{const c=n.current,d=o.current;if(d!==e){const m=i.current,p=Yn(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&m!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ue(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=p=>{const u=Yn(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&u&&(l("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},m=p=>{p.target===t&&(i.current=Yn(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:E.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function Yn(e){return(e==null?void 0:e.animationName)||"none"}function Og(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var[qn]=Nr("Tooltip",[Xt]),Xn=Xt(),Gl="TooltipProvider",Ig=700,di="tooltip.open",[Pg,ui]=qn(Gl),Kl=e=>{const{__scopeTooltip:t,delayDuration:r=Ig,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=E.useRef(!0),a=E.useRef(!1),l=E.useRef(0);return E.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),h.jsx(Pg,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:E.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:E.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})};Kl.displayName=Gl;var Pr="Tooltip",[Dg,Dr]=qn(Pr),Yl=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=ui(Pr,e.__scopeTooltip),c=Xn(t),[d,f]=E.useState(null),m=zr(),p=E.useRef(0),w=s??l.disableHoverableContent,u=a??l.delayDuration,g=E.useRef(!1),[b,v]=Pn({prop:n,defaultProp:o??!1,onChange:z=>{z?(l.onOpen(),document.dispatchEvent(new CustomEvent(di))):l.onClose(),i==null||i(z)},caller:Pr}),k=E.useMemo(()=>b?g.current?"delayed-open":"instant-open":"closed",[b]),_=E.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),S=E.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),O=E.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},u)},[u,v]);return E.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),h.jsx(Go,{...c,children:h.jsx(Dg,{scope:t,contentId:m,open:b,stateAttribute:k,trigger:d,onTriggerChange:f,onTriggerEnter:E.useCallback(()=>{l.isOpenDelayedRef.current?O():_()},[l.isOpenDelayedRef,O,_]),onTriggerLeave:E.useCallback(()=>{w?S():(window.clearTimeout(p.current),p.current=0)},[S,w]),onOpen:_,onClose:S,disableHoverableContent:w,children:r})})};Yl.displayName=Pr;var fi="TooltipTrigger",ql=E.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Dr(fi,r),i=ui(fi,r),s=Xn(r),a=E.useRef(null),l=Oe(t,a,o.onTriggerChange),c=E.useRef(!1),d=E.useRef(!1),f=E.useCallback(()=>c.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),h.jsx(On,{asChild:!0,...s,children:h.jsx(Te.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:ze(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:ze(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:ze(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ze(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:ze(e.onBlur,o.onClose),onClick:ze(e.onClick,o.onClose)})})});ql.displayName=fi;var pi="TooltipPortal",[Rg,Mg]=qn(pi,{forceMount:void 0}),Xl=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=Dr(pi,t);return h.jsx(Rg,{scope:t,forceMount:r,children:h.jsx(Ir,{present:r||i.open,children:h.jsx(In,{asChild:!0,container:o,children:n})})})};Xl.displayName=pi;var ir="TooltipContent",Jl=E.forwardRef((e,t)=>{const r=Mg(ir,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=Dr(ir,e.__scopeTooltip);return h.jsx(Ir,{present:n||s.open,children:s.disableHoverableContent?h.jsx(Ql,{side:o,...i,ref:t}):h.jsx(Lg,{side:o,...i,ref:t})})}),Lg=E.forwardRef((e,t)=>{const r=Dr(ir,e.__scopeTooltip),n=ui(ir,e.__scopeTooltip),o=E.useRef(null),i=Oe(t,o),[s,a]=E.useState(null),{trigger:l,onClose:c}=r,d=o.current,{onPointerInTransitChange:f}=n,m=E.useCallback(()=>{a(null),f(!1)},[f]),p=E.useCallback((w,u)=>{const g=w.currentTarget,b={x:w.clientX,y:w.clientY},v=Wg(b,g.getBoundingClientRect()),k=Hg(b,v),_=Vg(u.getBoundingClientRect()),S=Gg([...k,..._]);a(S),f(!0)},[f]);return E.useEffect(()=>()=>m(),[m]),E.useEffect(()=>{if(l&&d){const w=g=>p(g,d),u=g=>p(g,l);return l.addEventListener("pointerleave",w),d.addEventListener("pointerleave",u),()=>{l.removeEventListener("pointerleave",w),d.removeEventListener("pointerleave",u)}}},[l,d,p,m]),E.useEffect(()=>{if(s){const w=u=>{const g=u.target,b={x:u.clientX,y:u.clientY},v=(l==null?void 0:l.contains(g))||(d==null?void 0:d.contains(g)),k=!Zg(b,s);v?m():k&&(m(),c())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[l,d,s,c,m]),h.jsx(Ql,{...e,ref:i})}),[Fg,Bg]=qn(Pr,{isInside:!1}),Ug=np("TooltipContent"),Ql=E.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Dr(ir,r),c=Xn(r),{onClose:d}=l;return E.useEffect(()=>(document.addEventListener(di,d),()=>document.removeEventListener(di,d)),[d]),E.useEffect(()=>{if(l.trigger){const f=m=>{const p=m.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),h.jsx(yn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:h.jsxs(Ko,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(Ug,{children:n}),h.jsx(Fg,{scope:r,isInside:!0,children:h.jsx(tm,{id:l.contentId,role:"tooltip",children:o||n})})]})})});Jl.displayName=ir;var ec="TooltipArrow",$g=E.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Xn(r);return Bg(ec,r).isInside?null:h.jsx(Yo,{...o,...n,ref:t})});$g.displayName=ec;function Wg(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Hg(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Vg(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Zg(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],c=a.x,d=a.y,f=l.x,m=l.y;d>n!=m>n&&r<(f-c)*(n-d)/(m-d)+c&&(o=!o)}return o}function Gg(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Kg(t)}function Kg(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],s=r[r.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Yg=Kl,qg=Yl,Xg=ql,Jg=Xl,tc=Jl;const Qg=Yg,Rr=qg,Mr=Xg,sr=E.forwardRef(({className:e,sideOffset:t=4,...r},n)=>h.jsx(Jg,{children:h.jsx(tc,{ref:n,sideOffset:t,className:ye("z-50 rounded-md bg-zinc-800 px-2.5 py-1.5 text-[11px] text-zinc-200 shadow-md","animate-in fade-in-0 zoom-in-95",e),...r})}));sr.displayName=tc.displayName;var Jn="Popover",[rc]=Nr(Jn,[Xt]),Lr=Xt(),[e0,Ct]=rc(Jn),nc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Lr(t),l=E.useRef(null),[c,d]=E.useState(!1),[f,m]=Pn({prop:n,defaultProp:o??!1,onChange:i,caller:Jn});return h.jsx(Go,{...a,children:h.jsx(e0,{scope:t,contentId:zr(),triggerRef:l,open:f,onOpenChange:m,onOpenToggle:E.useCallback(()=>m(p=>!p),[m]),hasCustomAnchor:c,onCustomAnchorAdd:E.useCallback(()=>d(!0),[]),onCustomAnchorRemove:E.useCallback(()=>d(!1),[]),modal:s,children:r})})};nc.displayName=Jn;var oc="PopoverAnchor",t0=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ct(oc,r),i=Lr(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return E.useEffect(()=>(s(),()=>a()),[s,a]),h.jsx(On,{...i,...n,ref:t})});t0.displayName=oc;var ic="PopoverTrigger",sc=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ct(ic,r),i=Lr(r),s=Oe(t,o.triggerRef),a=h.jsx(Te.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":uc(o.open),...n,ref:s,onClick:ze(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:h.jsx(On,{asChild:!0,...i,children:a})});sc.displayName=ic;var hi="PopoverPortal",[r0,n0]=rc(hi,{forceMount:void 0}),ac=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Ct(hi,t);return h.jsx(r0,{scope:t,forceMount:r,children:h.jsx(Ir,{present:r||i.open,children:h.jsx(In,{asChild:!0,container:o,children:n})})})};ac.displayName=hi;var ar="PopoverContent",lc=E.forwardRef((e,t)=>{const r=n0(ar,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Ct(ar,e.__scopePopover);return h.jsx(Ir,{present:n||i.open,children:i.modal?h.jsx(i0,{...o,ref:t}):h.jsx(s0,{...o,ref:t})})});lc.displayName=ar;var o0=Zt("PopoverContent.RemoveScroll"),i0=E.forwardRef((e,t)=>{const r=Ct(ar,e.__scopePopover),n=E.useRef(null),o=Oe(t,n),i=E.useRef(!1);return E.useEffect(()=>{const s=n.current;if(s)return Ka(s)},[]),h.jsx(ti,{as:o0,allowPinchZoom:!0,children:h.jsx(cc,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ze(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ze(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:ze(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),s0=E.forwardRef((e,t)=>{const r=Ct(ar,e.__scopePopover),n=E.useRef(!1),o=E.useRef(!1);return h.jsx(cc,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=r.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),cc=E.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:d,...f}=e,m=Ct(ar,r),p=Lr(r);return sa(),h.jsx(Io,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:h.jsx(yn,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:h.jsx(Ko,{"data-state":uc(m.open),role:"dialog",id:m.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),dc="PopoverClose",a0=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Ct(dc,r);return h.jsx(Te.button,{type:"button",...n,ref:t,onClick:ze(e.onClick,()=>o.onOpenChange(!1))})});a0.displayName=dc;var l0="PopoverArrow",c0=E.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Lr(r);return h.jsx(Yo,{...o,...n,ref:t})});c0.displayName=l0;function uc(e){return e?"open":"closed"}var d0=nc,u0=sc,f0=ac,fc=lc;const p0=d0,h0=u0,pc=E.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},o)=>h.jsx(f0,{children:h.jsx(fc,{ref:o,align:t,sideOffset:r,className:ye("z-50 w-[var(--radix-popover-trigger-width)] rounded-lg border border-zinc-700/80 bg-zinc-950 p-1 text-white shadow-xl shadow-black/30","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2",e),...n})}));pc.displayName=fc.displayName;const hc=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",m0=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:o,className:i,currentPageLabel:s})=>{const[a,l]=N.useState(!1),c=s??hc(t),d=f=>{r(f),l(!1)};return h.jsx("div",{className:ye("mx-3 mt-2 mb-2",i),children:h.jsxs(p0,{open:a,onOpenChange:l,children:[h.jsx(h0,{asChild:!0,children:h.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${c}`,className:ye("flex items-center gap-2 w-full pl-3 pr-4 py-2 rounded-lg border text-left transition-all duration-150 cursor-pointer","bg-transparent border-zinc-800 text-zinc-400 hover:text-zinc-200 hover:bg-zinc-800/50 hover:border-zinc-700","data-[state=open]:bg-zinc-950 data-[state=open]:border-zinc-800 data-[state=open]:text-zinc-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950"),children:[h.jsx(Rd,{size:14,className:"shrink-0 text-zinc-500","aria-hidden":!0}),h.jsx("span",{className:"text-xs font-medium flex-1 truncate",children:c}),h.jsx(Xr,{size:13,className:"shrink-0 text-zinc-500","aria-hidden":!0})]})}),h.jsxs(pc,{align:"start",sideOffset:4,className:"min-w-[var(--radix-popover-trigger-width)] bg-zinc-950 border-zinc-800 p-1",role:"listbox","aria-label":"Page list",children:[e.map(f=>{const m=f===t,p=hc(f);return h.jsxs("button",{type:"button",role:"option","aria-selected":m,onClick:()=>d(f),className:ye("flex items-center justify-between w-full px-2.5 py-2 rounded-md text-xs transition-colors cursor-pointer",m?"bg-primary/10 text-primary font-semibold":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"),children:[h.jsx("span",{children:p}),n!=null&&h.jsxs("span",{className:"text-[10px] text-zinc-600 tabular-nums","aria-hidden":!0,children:[n,"s"]})]},f)}),o!=null&&h.jsx("div",{className:"border-t border-zinc-800 mt-1 pt-1",children:h.jsxs("button",{type:"button",onClick:()=>{o(),l(!1)},className:"flex items-center gap-1.5 w-full px-2.5 py-2 rounded-md text-[11px] text-zinc-600 hover:text-zinc-300 hover:bg-zinc-800 transition-colors cursor-pointer","aria-label":"New page",children:[h.jsx(co,{size:12,"aria-hidden":!0}),h.jsx("span",{children:"New page"})]})})]})]})})},mi=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),mc=new Set(["ui:editorial-markdown"]),gc=e=>e instanceof Pe.z.ZodOptional||e instanceof Pe.z.ZodDefault||e instanceof Pe.z.ZodNullable?gc(e._def.innerType):e,gi=e=>{var i;if(!e)return"";const t=e,r=typeof e.description=="string"?e.description:null;if(r)return r;const n=typeof((i=t._def)==null?void 0:i.description)=="string"?t._def.description:null;if(n)return n;const o=gc(e);return o!==e?gi(o):""},bi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),g0={activationConstraint:{distance:8}},b0={activationConstraint:{delay:200,tolerance:5}};function vi({layer:e,opts:t,dragHandleProps:r}){const{isSelected:n,isActive:o,isDragging:i,canDelete:s,onSelect:a,onOpenSettings:l,onDelete:c}=t,d=!!r;return h.jsxs("div",{className:ye("group flex items-center gap-2 pl-1 pr-2 py-2.5 rounded-lg text-left transition-all duration-200 cursor-pointer border-l-2",n?"bg-primary/[0.08] border-primary":o?"bg-zinc-800/30 border-emerald-500/60":"border-transparent hover:bg-zinc-800/40",i&&"opacity-50 shadow-lg",d?"cursor-grab active:cursor-grabbing":"cursor-default"),children:[d?h.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-150 cursor-grab touch-none","aria-label":"Trascina per riordinare",...r,children:h.jsx(os,{size:12,className:"text-zinc-600"})}):h.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 pointer-events-none",children:h.jsx(os,{size:12,className:"text-zinc-600/50"})}),h.jsxs("button",{type:"button",onClick:a,className:"flex-1 min-w-0 text-left",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:ye("text-xs font-bold uppercase tracking-[0.06em] truncate",n?"text-primary":"text-zinc-500"),children:e.type}),o&&h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0","aria-hidden":!0})]}),h.jsx("span",{className:"text-[11px] text-zinc-600 block truncate leading-snug mt-0.5",children:e.title??`${e.type} section`})]}),h.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity duration-150",children:[h.jsxs(Rr,{children:[h.jsx(Mr,{asChild:!0,children:h.jsx(Ze,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-zinc-300",onClick:f=>{f.stopPropagation(),l(f)},children:h.jsx(Ud,{size:12})})}),h.jsx(sr,{children:"Settings"})]}),s&&h.jsxs(Rr,{children:[h.jsx(Mr,{asChild:!0,children:h.jsx(Ze,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-destructive",onClick:f=>{f.stopPropagation(),c()},children:h.jsx(Qr,{size:12})})}),h.jsx(sr,{children:"Delete section"})]})]})]})}function v0({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:o,transform:i,transition:s,isDragging:a}=Gf({id:e.id,disabled:!t.canReorder}),l={transform:vt.Transform.toString(i),transition:s};return h.jsx("div",{ref:o,style:l,className:ye(a&&"z-10"),children:h.jsx(vi,{layer:e,opts:{...t,isDragging:a},dragHandleProps:t.canReorder?{...r,...n,"aria-roledescription":"elemento trascinabile"}:void 0})})}const bc=({selectedSection:e,pageData:t,allSectionsData:r=[],onUpdate:n,onUpdateSection:o,onClose:i,expandedItemPath:s=null,onReorderSection:a,allLayers:l=[],activeSectionId:c,onRequestScrollToSection:d,onDeleteSection:f,onAddSection:m,hasChanges:p=!1,onSaveToFile:w,onHotSave:u,saveSuccessFeedback:g=!1,hotSaveSuccessFeedback:b=!1,hotSaveInProgress:v=!1,showLegacySave:k=!0,showHotSave:_=!1,onResetToFile:S,showResetToFile:O=!1,pageSlugs:z=[],currentSlug:I="home",onPageChange:D})=>{const{schemas:U}=fr(),[H,C]=N.useState(!0),[M,y]=N.useState(null),[L,Q]=N.useState(null),[F,$]=N.useState(null),[V,re]=N.useState(null),A=N.useRef(null),P=N.useRef(null),J=vu(go(_o,g0),go(Os,b0),go(yo,{coordinateGetter:qf})),G=N.useDeferredValue(e),te=e!=null&&(G==null?void 0:G.id)!==e.id,ce=s&&s.length>0?s:F?[F]:null,q=ce!=null&&ce.length?{fieldKey:ce[ce.length-1].fieldKey,itemId:ce[ce.length-1].itemId}:null,ie=N.useRef(s);N.useEffect(()=>{ie.current!=null&&s==null&&$(null),ie.current=s},[s]),N.useEffect(()=>{(e==null?void 0:e.id)!=null&&C(!1)},[e==null?void 0:e.id]);const ue=()=>{const Z=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const de=A.current;de&&de.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(Z)},ae=N.useRef(H);N.useEffect(()=>{if(H&&!ae.current){const Z=ue();return ae.current=H,Z}ae.current=H},[H]),N.useEffect(()=>{if(!q)return;const Z=A.current;if(!Z)return;const de=requestAnimationFrame(()=>{const le=Z.querySelector("[data-jp-expanded-item]")??Z.querySelector("[data-jp-focused-field]");le&&le.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(de)},[q]);const pe=Z=>{C(!1),d==null||d(Z)},ve=()=>{C(Z=>{const de=!Z;return de&&ue(),de})},_e=(Z,de)=>{de.stopPropagation(),r.length>0&&o?re(Z):(C(!1),d==null||d(Z))};N.useEffect(()=>{if(V==null)return;const Z=de=>{de.key==="Escape"&&re(null)};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[V]);const x=Z=>{M===Z?(f==null||f(Z),y(null)):(y(Z),setTimeout(()=>y(null),3e3))},K=N.useMemo(()=>l.filter(Z=>Z.scope==="local").map(Z=>Z.id),[l]),W=!!a&&K.length>0,T=Z=>{Q(Z.active.id)},j=Z=>{Q(null);const{active:de,over:le}=Z;if(!le||de.id===le.id||!a)return;const we=l.findIndex(ge=>ge.id===de.id),ee=l.findIndex(ge=>ge.id===le.id);if(we===-1||ee===-1)return;const oe=we<ee?ee:ee-1;a(de.id,oe)},R=e?t.sections.find(Z=>Z.id===e.id):void 0,Y=G?t.sections.find(Z=>Z.id===G.id):void 0,X=G?U[G.type]:void 0,B=N.useMemo(()=>{if(!X)return!1;const Z=X.shape,de=Object.keys(Z).filter(le=>!mi.has(le));return de.length===0?!1:de.every(le=>mc.has(gi(Z[le])))},[X]);N.useEffect(()=>{(e==null?void 0:e.id)!=null&&B&&C(!0)},[e==null?void 0:e.id,B]);const ne=l.length>0&&(H||!e),fe=I?I.charAt(0).toUpperCase()+I.slice(1):"Select page",se=N.useMemo(()=>{const Z=[];let de=null;for(const le of l){const we=le.type.toUpperCase(),ee=de!==null&&(de==="HEADER"&&we!=="HEADER"||de!=="HEADER"&&de!=="FOOTER"&&we==="FOOTER");Z.push({layer:le,showSeparatorAbove:ee}),de=we}return Z},[l]);return h.jsx(Qg,{children:h.jsxs("aside",{className:"relative w-full h-full bg-zinc-950 border-l border-zinc-800 flex flex-col shadow-2xl shrink-0 min-w-0 animate-in slide-in-from-right duration-300",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("h2",{className:"text-sm font-bold text-white",children:"Inspector"}),h.jsx("p",{className:"text-[10px] tracking-[0.06em] text-zinc-600 mt-0.5",children:e?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"text-primary font-bold",children:e.type}),h.jsx("span",{className:"text-zinc-700 mx-1.5",children:"|"}),h.jsx("span",{className:"uppercase",children:e.scope})]}):h.jsxs("span",{className:"text-zinc-600",children:[fe," · ",l.length," sections"]})})]}),h.jsx(Ze,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close Inspector",children:h.jsx(Ft,{size:14})})]}),z.length>0&&D&&h.jsx(m0,{pageSlugs:z,currentSlug:I,onPageChange:D,sectionCount:l.length,currentPageLabel:fe}),l.length>0&&h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-t border-zinc-800/50",children:[h.jsxs("button",{type:"button",onClick:ve,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":ne,"aria-label":ne?"Collapse Page Layers":"Expand Page Layers",children:[h.jsx(lo,{size:14,className:"text-zinc-500 shrink-0"}),h.jsx("span",{className:"text-[11px] font-semibold tracking-[0.04em] text-zinc-400",children:"Page Layers"}),h.jsxs("span",{className:"text-[10px] text-zinc-600",children:["(",l.length,")"]}),h.jsx(ao,{size:13,className:ye("ml-auto text-zinc-600 transition-transform duration-200 shrink-0",!H&&"rotate-180")})]}),m!=null&&h.jsxs(Rr,{children:[h.jsx(Mr,{asChild:!0,children:h.jsx(Ze,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:m,children:h.jsx(co,{size:14})})}),h.jsx(sr,{children:"Add section"})]})]}),h.jsx("div",{className:"relative flex-1 min-h-0 min-w-0 flex flex-col overflow-hidden",children:h.jsxs("div",{ref:A,className:"min-h-0 min-w-0 flex-1 overflow-y-auto overflow-x-hidden flex flex-col",role:"region","aria-label":"Inspector content",children:[h.jsx("div",{className:"flex flex-col min-h-0",children:ne&&h.jsxs("div",{className:"py-1",children:[h.jsxs(gf,{sensors:J,collisionDetection:yu,modifiers:[Pf],onDragStart:T,onDragEnd:j,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:Z})=>Z?`Posizione ${K.indexOf(String(Z.id))+1} di ${K.length}.`:void 0,onDragEnd:({over:Z})=>Z?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[h.jsx(Bf,{items:K,strategy:Lf,children:h.jsx("div",{className:"px-2 space-y-0.5",children:se.map(({layer:Z,showSeparatorAbove:de})=>h.jsxs(N.Fragment,{children:[de&&h.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),Z.scope==="local"&&W?h.jsx(v0,{layer:Z,opts:{isSelected:(e==null?void 0:e.id)===Z.id,isActive:c===Z.id,isDragging:!1,canReorder:!0,canDelete:!!f,deleteConfirm:M===Z.id,onSelect:()=>pe(Z.id),onDelete:()=>x(Z.id),onOpenSettings:le=>_e(Z.id,le)}}):h.jsx("div",{children:h.jsx(vi,{layer:Z,opts:{isSelected:(e==null?void 0:e.id)===Z.id,isActive:c===Z.id,isDragging:!1,canDelete:Z.scope==="local"&&!!f,deleteConfirm:M===Z.id,onSelect:()=>pe(Z.id),onDelete:()=>x(Z.id),onOpenSettings:le=>_e(Z.id,le)}})})]},Z.id))})}),h.jsx(If,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:L?(()=>{const Z=l.find(de=>de.id===L);return Z?h.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:h.jsx(vi,{layer:Z,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),M&&h.jsxs("div",{className:"flex items-center gap-2 py-2 px-3 mt-1 mx-2 rounded-md bg-amber-500/10 border border-amber-500/30",children:[h.jsx(Id,{size:12,className:"text-amber-500 shrink-0"}),h.jsx("p",{className:"text-[10px] text-amber-500 font-medium",children:"Click delete again to confirm"})]})]})}),q&&R&&(()=>{const Z=R.data||{};let de;if(ce&&ce.length>0){let le=Z;for(const oe of ce){const ge=le==null?void 0:le[oe.fieldKey];oe.itemId!=null&&Array.isArray(ge)?le=ge.find(xe=>String(xe==null?void 0:xe.id)===String(oe.itemId))??null:le=ge}const we=le||{},ee=q.fieldKey;de=(typeof we.name=="string"?we.name:null)??(typeof we.title=="string"?we.title:null)??(typeof we.label=="string"?we.label:null)??bi(ee)}else{const le=q.fieldKey;if(q.itemId!=null){const oe=(Array.isArray(Z[le])?Z[le]:[]).find(ge=>String(ge==null?void 0:ge.id)===String(q.itemId))||{};de=(typeof oe.name=="string"?oe.name:null)??(typeof oe.title=="string"?oe.title:null)??(typeof oe.label=="string"?oe.label:null)??bi(le)}else de=bi(le)}return h.jsxs("div",{className:"px-4 py-2 border-b border-zinc-800 bg-zinc-900/50",children:[h.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-zinc-500",children:"Editing"}),h.jsx("p",{className:"text-xs font-medium text-white truncate mt-0.5",children:de})]})})(),h.jsx("div",{className:"flex-1 p-4",onFocusCapture:()=>e!=null&&C(!1),children:e?te?h.jsxs("div",{className:"space-y-4 animate-pulse",role:"status","aria-label":"Loading form",children:[h.jsx("div",{className:"h-4 w-3/4 rounded bg-zinc-800"}),h.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),h.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),h.jsx("div",{className:"h-20 rounded bg-zinc-800/80"}),h.jsx("div",{className:"h-10 rounded bg-zinc-800/60"})]}):X?(()=>{const de=Object.keys(X.shape).filter(we=>!mi.has(we)&&!mc.has(gi(X.shape[we]))),le=(Y==null?void 0:Y.data)||{};return de.length===0?h.jsx("p",{className:"text-xs text-zinc-500",children:"Inline editorial section: edit content directly on the canvas."}):h.jsx(Or,{schema:X,data:le,onChange:we=>n(we),keys:de,expandedItemPath:ce,onSidebarExpandedItemChange:$})})():h.jsxs("div",{className:"text-xs text-red-400 p-4 border border-dashed border-red-900/30 rounded bg-red-900/10",children:["No schema found for ",(G==null?void 0:G.type)??e.type]}):h.jsx("p",{className:"text-xs text-zinc-600 text-center py-10",children:"Select a layer above or on the stage to edit."})})]})}),h.jsx("div",{className:"px-4 py-2.5 border-t border-zinc-800 bg-zinc-900/50 flex items-center justify-between gap-3 opacity-100 shrink-0",children:(k&&w!=null||_&&u!=null||S!=null)&&h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("div",{className:ye("w-2 h-2 rounded-full transition-colors duration-300 shrink-0",p?"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.5)]":"bg-emerald-500")}),h.jsx("span",{className:ye("text-sm font-medium transition-colors duration-300 truncate",g||b?"text-emerald-400":p?"text-amber-500":"text-zinc-500"),children:g||b?"Saved":p?"Unsaved Changes":"All Changes Saved"})]}),k&&w!=null&&h.jsxs(Rr,{children:[h.jsx(Mr,{asChild:!0,children:h.jsxs(Ze,{size:"default",disabled:!p,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:Z=>{Z.preventDefault(),Z.stopPropagation(),w()},children:[h.jsx(ss,{size:14}),h.jsx("span",{children:"Save"})]})}),h.jsx(sr,{children:"Save (export JSON)"})]}),_&&u!=null&&h.jsxs(Rr,{children:[h.jsx(Mr,{asChild:!0,children:h.jsxs(Ze,{size:"default",disabled:!p||v,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:Z=>{Z.preventDefault(),Z.stopPropagation(),u()},children:[h.jsx(ss,{size:14}),h.jsx("span",{children:v?"Saving...":"Hot Save"})]})}),h.jsx(sr,{children:"Hot save to edge"})]}),S!=null&&O&&h.jsx("button",{type:"button",onClick:S,className:"shrink-0 flex items-center gap-1.5 px-2 py-1 rounded text-[11px] font-medium transition-all border border-zinc-700 bg-zinc-900 text-zinc-400 hover:bg-zinc-800 hover:border-zinc-600 hover:text-zinc-300",title:"Ripristina la pagina dal file (elimina le modifiche in memoria)",children:h.jsx("span",{children:"Ripristina da file"})})]})}),V!=null&&r.length>0&&o!=null&&(()=>{const Z=r.find(xe=>xe.id===V),de=l.find(xe=>xe.id===V);if(!Z)return null;const le=(de==null?void 0:de.scope)==="global"?"global":"local",we=Z.type,ee=U[we],ge=(ee?Object.keys(ee.shape):[]).filter(xe=>mi.has(xe)),be=Z.data??{};return ge.length===0?h.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:()=>re(null),children:h.jsxs("div",{ref:P,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full overflow-hidden",onClick:xe=>xe.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800",children:[h.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",we]}),h.jsx("button",{type:"button",onClick:()=>re(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings",children:h.jsx(Ft,{size:18})})]}),h.jsx("div",{className:"p-4",children:h.jsx("p",{className:"text-xs text-zinc-500",children:"No settings fields for this section."})})]})}):h.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:xe=>xe.target===xe.currentTarget&&re(null),children:h.jsxs("div",{ref:P,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full max-h-[85vh] flex flex-col overflow-hidden",onClick:xe=>xe.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[h.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",we]}),h.jsx("button",{type:"button",onClick:()=>re(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings (Escape)",children:h.jsx(Ft,{size:18})})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar",children:h.jsx(Or,{schema:ee,data:be,onChange:xe=>{const je={...Z.data,...xe};o(V,le,we,je)},keys:ge})})]})})})()]})})},vc=({draft:e,globalDraft:t,menuConfig:r,themeConfig:n,slug:o,selectedId:i,scrollToSectionId:s,onScrollRequested:a})=>{const l=N.useRef(null),c=N.useCallback(()=>{var d;(d=l.current)!=null&&d.contentWindow&&l.current.contentWindow.postMessage({type:Ae.UPDATE_DRAFTS,draft:e,globalDraft:t,menuConfig:r,themeConfig:n},"*")},[e,t,r,n]);return N.useEffect(()=>{c()},[c]),N.useEffect(()=>{const d=f=>{f.data.type===Ae.STAGE_READY&&c()};return window.addEventListener("message",d),()=>window.removeEventListener("message",d)},[c]),N.useEffect(()=>{var d;(d=l.current)!=null&&d.contentWindow&&l.current.contentWindow.postMessage({type:Ae.SYNC_SELECTION,selectedId:i},"*")},[i]),N.useEffect(()=>{var d;!s||!((d=l.current)!=null&&d.contentWindow)||(l.current.contentWindow.postMessage({type:Ae.REQUEST_SCROLL_TO_SECTION,sectionId:s},"*"),a==null||a())},[s,a]),h.jsx("div",{className:"w-full h-full bg-background overflow-hidden",children:h.jsx("iframe",{ref:l,src:`/admin/preview/${o}`,className:"w-full h-full border-none",title:"JsonPages Stage"})})},xi=new Set;function x0(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function xc(e,t=[],r={}){return Object.entries(e).forEach(([n,o])=>{const i=[...t,x0(n)];if(typeof o=="string"||typeof o=="number"){r[`--theme-${i.join("-")}`]=String(o);return}o&&typeof o=="object"&&!Array.isArray(o)&&xc(o,i,r)}),r}function We(e,t,r,n){n&&(e[t]=`var(${r})`)}function w0(e){const t=xc(e.tokens),r={...t};return We(r,"--theme-primary","--theme-colors-primary",t["--theme-colors-primary"]),We(r,"--theme-secondary","--theme-colors-secondary",t["--theme-colors-secondary"]),We(r,"--theme-accent","--theme-colors-accent",t["--theme-colors-accent"]),We(r,"--theme-background","--theme-colors-background",t["--theme-colors-background"]),We(r,"--theme-surface","--theme-colors-surface",t["--theme-colors-surface"]),We(r,"--theme-surface-alt","--theme-colors-surface-alt",t["--theme-colors-surface-alt"]),We(r,"--theme-text","--theme-colors-text",t["--theme-colors-text"]),We(r,"--theme-text-muted","--theme-colors-text-muted",t["--theme-colors-text-muted"]),We(r,"--theme-border","--theme-colors-border",t["--theme-colors-border"]),We(r,"--theme-font-primary","--theme-typography-font-family-primary",t["--theme-typography-font-family-primary"]),We(r,"--theme-font-mono","--theme-typography-font-family-mono",t["--theme-typography-font-family-mono"]),We(r,"--theme-font-display","--theme-typography-font-family-display",t["--theme-typography-font-family-display"]),We(r,"--theme-radius-sm","--theme-border-radius-sm",t["--theme-border-radius-sm"]),We(r,"--theme-radius-md","--theme-border-radius-md",t["--theme-border-radius-md"]),We(r,"--theme-radius-lg","--theme-border-radius-lg",t["--theme-border-radius-lg"]),r}const Fr={setTheme:e=>{const t=document.documentElement,r=w0(e);xi.forEach(n=>{t.style.removeProperty(n)}),xi.clear(),Object.entries(r).forEach(([n,o])=>{t.style.setProperty(n,o),xi.add(n)})}};function y0(e,t){if(!t)return e;const r=e[e.length-1];return r&&r.itemId==null&&r.fieldKey===t?e:[...e,{fieldKey:t}]}function wc(e,t){var i,s,a;const r=[];let n=null,o=e;for(;o&&o!==t;){const l=(i=o.getAttribute)==null?void 0:i.call(o,"data-jp-item-id"),c=(s=o.getAttribute)==null?void 0:s.call(o,"data-jp-item-field");if(l&&c&&r.push({fieldKey:c,itemId:l}),n==null){const d=(a=o.getAttribute)==null?void 0:a.call(o,"data-jp-field");d&&(n=d)}o=o.parentElement}return r.reverse(),y0(r,n)}const k0='[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',_0="[data-jp-field],[data-jp-item-id],[data-jp-item-field]",yc=()=>{var w;const[e,t]=N.useState(null),[r,n]=N.useState(null),[o,i]=N.useState({main:[]}),[s,a]=N.useState(null),[l,c]=N.useState(null),[d,f]=N.useState(!1);if(N.useEffect(()=>{const u=g=>{var b;if(!(g.origin!==window.location.origin||g.source!==window.parent)){if(g.data.type===Ae.UPDATE_DRAFTS&&(t(g.data.draft),n(g.data.globalDraft),(b=g.data.menuConfig)!=null&&b.main&&i({main:g.data.menuConfig.main}),g.data.themeConfig&&Fr.setTheme(g.data.themeConfig)),g.data.type===Ae.SYNC_SELECTION&&a(g.data.selectedId),g.data.type===Ae.REQUEST_SCROLL_TO_SECTION&&c(g.data.sectionId??null),g.data.type===Ae.REQUEST_INLINE_FLUSH){const v=typeof g.data.requestId=="string"?g.data.requestId:null;window.dispatchEvent(new CustomEvent(Ae.REQUEST_INLINE_FLUSH,{detail:{requestId:v}})),setTimeout(()=>{window.parent.postMessage({type:Ae.INLINE_FLUSHED,requestId:v},window.location.origin)},0)}g.data.type===Ae.REQUEST_CLEAN_HTML&&(f(!0),setTimeout(()=>{const v=document.documentElement.outerHTML;window.parent.postMessage({type:Ae.SEND_CLEAN_HTML,html:v},"*"),f(!1)},50))}};return window.addEventListener("message",u),window.parent.postMessage({type:Ae.STAGE_READY},"*"),()=>window.removeEventListener("message",u)},[]),N.useEffect(()=>{const u=v=>!!v.closest(_0),g=v=>!!(v.closest('[data-jp-ignore-select="true"]')||v.closest(k0)&&!u(v)||v.closest("a[href]")&&!u(v)),b=v=>{var L,Q,F;const k=v.target;if(g(k)){k.closest("a[href]")&&v.preventDefault();return}const _=v.clientX,S=v.clientY;let O=null,z=k;for(;z&&z!==document.body;){const $=(L=z.getAttribute)==null?void 0:L.call(z,"data-section-id"),V=(Q=z.getAttribute)==null?void 0:Q.call(z,"data-section-type"),re=(F=z.getAttribute)==null?void 0:F.call(z,"data-section-scope");if($&&V&&re){O=z;break}z=z.parentElement}if(!O)return;v.preventDefault(),v.stopPropagation();const I=O.getAttribute("data-section-id"),D=O.getAttribute("data-section-type"),U=O.getAttribute("data-section-scope");if(!I||!D||!U)return;const H={id:I,type:D,scope:U};if(k===O){window.parent.postMessage({type:Ae.SECTION_SELECT,section:H},"*");return}const C=document.elementFromPoint(_,S)??k;if(!C||!O.contains(C)){window.parent.postMessage({type:Ae.SECTION_SELECT,section:H},"*");return}if(C===O){window.parent.postMessage({type:Ae.SECTION_SELECT,section:H},"*");return}let M=wc(C,O);if(M.length===0&&C){let $=null;const V=re=>{var P,J;const A=re.getBoundingClientRect();if(A.left<=_&&_<=A.right&&A.top<=S&&S<=A.bottom){for(let G=0;G<re.children.length;G++)V(re.children[G]);((P=re.getAttribute)!=null&&P.call(re,"data-jp-item-id")||(J=re.getAttribute)!=null&&J.call(re,"data-jp-field"))&&($=re)}};V(C),$&&(M=wc($,O))}const y={type:Ae.SECTION_SELECT,section:H};M.length>0&&(y.itemPath=M),window.parent.postMessage(y,"*")};return document.addEventListener("click",b,!0),()=>document.removeEventListener("click",b,!0)},[]),N.useEffect(()=>{if(!l)return;const u=setTimeout(()=>c(null),600);return()=>clearTimeout(u)},[l]),!e||!r)return h.jsx("div",{className:"flex items-center justify-center h-screen w-full bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse",children:"Waiting for Studio Signal..."});const m={main:rn((w=r.header)==null?void 0:w.data,o.main)},p=u=>{window.parent.postMessage({type:Ae.ACTIVE_SECTION_CHANGED,activeSectionId:u},"*")};return h.jsx(qr,{mode:d?"visitor":"studio",children:h.jsx("div",{className:d?"":"jp-ice-active",children:h.jsx(fo,{pageConfig:e,siteConfig:r,menuConfig:m,selectedId:d?null:s,scrollToSectionId:l,onActiveSectionChange:p})})})};function S0(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const kc=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:o})=>{if(N.useEffect(()=>{if(!e)return;const s=a=>{a.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;const i=s=>(n==null?void 0:n[s])??S0(s);return h.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-labelledby":"jp-add-section-title",children:[h.jsx("div",{className:"absolute inset-0 bg-zinc-950/80 backdrop-blur-sm",onClick:t,"aria-hidden":"true"}),h.jsxs("div",{className:"relative w-full max-w-md max-h-[85vh] flex flex-col rounded-xl border border-zinc-700 bg-zinc-900 shadow-2xl overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-zinc-800 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/20 text-blue-400",children:h.jsx(lo,{size:18})}),h.jsx("h2",{id:"jp-add-section-title",className:"text-sm font-bold text-white",children:"Add section"})]}),h.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-md text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close",children:h.jsx(Ft,{size:18})})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:r.length===0?h.jsx("p",{className:"text-xs text-zinc-500 text-center py-8",children:"No section types available. Configure addableSectionTypes or schemas."}):h.jsx("ul",{className:"grid gap-2",role:"listbox",children:r.map(s=>h.jsx("li",{role:"option",children:h.jsxs("button",{type:"button",onClick:()=>{o(s),t()},className:ye("w-full flex items-center gap-3 px-4 py-3 rounded-lg text-left","border border-zinc-700/80 bg-zinc-800/50","hover:border-blue-500/40 hover:bg-zinc-800 transition-colors","focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:ring-offset-2 focus:ring-offset-zinc-900"),children:[h.jsx("span",{className:"flex items-center justify-center w-9 h-9 rounded-md bg-zinc-700/80 text-zinc-400 text-xs font-mono shrink-0",children:s}),h.jsx("span",{className:"text-sm font-medium text-zinc-200",children:i(s)})]})},s))})}),h.jsx("div",{className:"px-5 py-3 border-t border-zinc-800 shrink-0",children:h.jsx("p",{className:"text-[10px] text-zinc-500 uppercase tracking-wider",children:"Choose a section type to add to the bottom of this page"})})]})]})},_c=()=>h.jsxs("div",{style:{"--local-bg":"var(--color-background)","--local-text":"var(--color-text)","--local-text-muted":"var(--color-text-muted)","--local-primary":"var(--color-primary)","--local-radius-md":"var(--radius-md)"},className:"min-h-screen flex flex-col items-center justify-center bg-[var(--local-bg)] px-6",children:[h.jsx("h1",{className:"text-6xl font-bold text-[var(--local-text)] mb-4",children:"404"}),h.jsx("p",{className:"text-xl text-[var(--local-text-muted)] mb-8",children:"Page not found"}),h.jsx("a",{href:"/",className:"inline-flex items-center gap-2 px-6 py-3 rounded-[var(--local-radius-md)] bg-[var(--local-primary)] text-[var(--local-bg)] font-semibold text-sm hover:opacity-90 transition-opacity",children:"Back to Home"})]}),C0='/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-900:oklch(37.9% .146 265.522);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:var(--background);--color-foreground:var(--foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-destructive:var(--destructive);--color-ring:var(--ring)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.z-0{z-index:0}.z-10{z-index:10}.z-50,.z-\\[50\\]{z-index:50}.z-\\[60\\]{z-index:60}.z-\\[70\\]{z-index:70}.z-\\[100\\]{z-index:100}.z-\\[9998\\]{z-index:9998}.z-\\[9999\\]{z-index:9999}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-4{margin:calc(var(--spacing)*4)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-1\\.5{margin-inline:calc(var(--spacing)*1.5)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3{margin-inline:calc(var(--spacing)*3)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-14{height:calc(var(--spacing)*14)}.h-20{height:calc(var(--spacing)*20)}.h-40{height:calc(var(--spacing)*40)}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-screen{height:100vh}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\\[45vh\\]{max-height:45vh}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[90vh\\]{max-height:90vh}.max-h-\\[320px\\]{max-height:320px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-\\[18px\\]{min-height:18px}.min-h-\\[96px\\]{min-height:96px}.min-h-\\[240px\\]{min-height:240px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing)*1)}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-3\\/4{width:75%}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-\\[calc\\(100\\%-2rem\\)\\]{width:calc(100% - 2rem)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[var\\(--inspector-width\\,280px\\)\\]{max-width:var(--inspector-width,280px)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[18px\\]{min-width:18px}.min-w-\\[156px\\]{min-width:156px}.min-w-\\[var\\(--radix-popover-trigger-width\\)\\]{min-width:var(--radix-popover-trigger-width)}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-3{--tw-translate-x:calc(var(--spacing)*3);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-none{resize:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[var\\(--local-radius-md\\)\\]{border-radius:var(--local-radius-md)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-amber-500\\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-500\\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-blue-600{border-color:var(--color-blue-600)}.border-emerald-500\\/60{border-color:#00bb7f99}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\\/60{border-color:color-mix(in oklab,var(--color-emerald-500)60%,transparent)}}.border-primary{border-color:var(--color-primary)}.border-red-500\\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-red-900\\/30{border-color:#82181a4d}@supports (color:color-mix(in lab,red,red)){.border-red-900\\/30{border-color:color-mix(in oklab,var(--color-red-900)30%,transparent)}}.border-transparent{border-color:#0000}.border-zinc-700{border-color:var(--color-zinc-700)}.border-zinc-700\\/60{border-color:#3f3f4699}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/60{border-color:color-mix(in oklab,var(--color-zinc-700)60%,transparent)}}.border-zinc-700\\/80{border-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/80{border-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.border-zinc-800{border-color:var(--color-zinc-800)}.border-zinc-800\\/50{border-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/50{border-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.border-zinc-800\\/60{border-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/60{border-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.border-l-transparent{border-left-color:#0000}.bg-\\[var\\(--color-background\\)\\]{background-color:var(--color-background)}.bg-\\[var\\(--local-bg\\)\\]{background-color:var(--local-bg)}.bg-\\[var\\(--local-primary\\)\\]{background-color:var(--local-primary)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/5{background-color:color-mix(in oklab,var(--color-amber-500)5%,transparent)}}.bg-amber-500\\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-background{background-color:var(--color-background)}.bg-black{background-color:var(--color-black)}.bg-black\\/0{background-color:#0000}@supports (color:color-mix(in lab,red,red)){.bg-black\\/0{background-color:color-mix(in oklab,var(--color-black)0%,transparent)}}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-500\\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/15{background-color:color-mix(in oklab,var(--color-blue-500)15%,transparent)}}.bg-blue-500\\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-500\\/\\[0\\.04\\]{background-color:#3080ff0a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/\\[0\\.04\\]{background-color:color-mix(in oklab,var(--color-blue-500)4%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-600\\/10{background-color:#155dfc1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-600\\/10{background-color:color-mix(in oklab,var(--color-blue-600)10%,transparent)}}.bg-destructive\\/15{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\\/15{background-color:color-mix(in oklab,var(--color-destructive)15%,transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-primary,.bg-primary\\/10{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/10{background-color:color-mix(in oklab,var(--color-primary)10%,transparent)}}.bg-primary\\/\\[0\\.08\\]{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/\\[0\\.08\\]{background-color:color-mix(in oklab,var(--color-primary)8%,transparent)}}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/15{background-color:color-mix(in oklab,var(--color-red-500)15%,transparent)}}.bg-red-900\\/10{background-color:#82181a1a}@supports (color:color-mix(in lab,red,red)){.bg-red-900\\/10{background-color:color-mix(in oklab,var(--color-red-900)10%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-white\\/\\[0\\.01\\]{background-color:#ffffff03}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.01\\]{background-color:color-mix(in oklab,var(--color-white)1%,transparent)}}.bg-white\\/\\[0\\.02\\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.02\\]{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.bg-white\\/\\[0\\.03\\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.03\\]{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.bg-zinc-700{background-color:var(--color-zinc-700)}.bg-zinc-700\\/80{background-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-700\\/80{background-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.bg-zinc-800{background-color:var(--color-zinc-800)}.bg-zinc-800\\/30{background-color:#27272a4d}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/30{background-color:color-mix(in oklab,var(--color-zinc-800)30%,transparent)}}.bg-zinc-800\\/50{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/50{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.bg-zinc-800\\/60{background-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/60{background-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.bg-zinc-800\\/80{background-color:#27272acc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/80{background-color:color-mix(in oklab,var(--color-zinc-800)80%,transparent)}}.bg-zinc-900{background-color:var(--color-zinc-900)}.bg-zinc-900\\/20{background-color:#18181b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/20{background-color:color-mix(in oklab,var(--color-zinc-900)20%,transparent)}}.bg-zinc-900\\/40{background-color:#18181b66}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/40{background-color:color-mix(in oklab,var(--color-zinc-900)40%,transparent)}}.bg-zinc-900\\/50{background-color:#18181b80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/50{background-color:color-mix(in oklab,var(--color-zinc-900)50%,transparent)}}.bg-zinc-900\\/60{background-color:#18181b99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/60{background-color:color-mix(in oklab,var(--color-zinc-900)60%,transparent)}}.bg-zinc-950{background-color:var(--color-zinc-950)}.bg-zinc-950\\/80{background-color:#09090bcc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-950\\/80{background-color:color-mix(in oklab,var(--color-zinc-950)80%,transparent)}}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\\/70{--tw-gradient-from:#000000b3}@supports (color:color-mix(in lab,red,red)){.from-black\\/70{--tw-gradient-from:color-mix(in oklab,var(--color-black)70%,transparent)}}.from-black\\/70{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\\/80{--tw-gradient-from:#000c}@supports (color:color-mix(in lab,red,red)){.from-black\\/80{--tw-gradient-from:color-mix(in oklab,var(--color-black)80%,transparent)}}.from-black\\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2\\.5{padding:calc(var(--spacing)*2.5)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.p-px{padding:1px}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\\.5{padding-inline:calc(var(--spacing)*3.5)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-7{padding-block:calc(var(--spacing)*7)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-9{padding-left:calc(var(--spacing)*9)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.01em\\]{--tw-tracking:.01em;letter-spacing:.01em}.tracking-\\[0\\.02em\\]{--tw-tracking:.02em;letter-spacing:.02em}.tracking-\\[0\\.2em\\]{--tw-tracking:.2em;letter-spacing:.2em}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.06em\\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.whitespace-nowrap{white-space:nowrap}.text-\\[var\\(--local-bg\\)\\]{color:var(--local-bg)}.text-\\[var\\(--local-text\\)\\]{color:var(--local-text)}.text-\\[var\\(--local-text-muted\\)\\]{color:var(--local-text-muted)}.text-amber-200{color:var(--color-amber-200)}.text-amber-500{color:var(--color-amber-500)}.text-amber-500\\/70{color:#f99c00b3}@supports (color:color-mix(in lab,red,red)){.text-amber-500\\/70{color:color-mix(in oklab,var(--color-amber-500)70%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-destructive{color:var(--color-destructive)}.text-emerald-400{color:var(--color-emerald-400)}.text-foreground{color:var(--color-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-zinc-100{color:var(--color-zinc-100)}.text-zinc-200{color:var(--color-zinc-200)}.text-zinc-300{color:var(--color-zinc-300)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-600\\/50{color:#52525c80}@supports (color:color-mix(in lab,red,red)){.text-zinc-600\\/50{color:color-mix(in oklab,var(--color-zinc-600)50%,transparent)}}.text-zinc-700{color:var(--color-zinc-700)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-20{opacity:.2}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_8px_rgba\\(245\\,158\\,11\\,0\\.5\\)\\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#f59e0b80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\\/30{--tw-shadow-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.shadow-black\\/30{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-black)30%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-blue-900\\/20{--tw-shadow-color:#1c398e33}@supports (color:color-mix(in lab,red,red)){.shadow-blue-900\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-blue-900)20%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-primary\\/20{--tw-shadow-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.shadow-primary\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-primary)20%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-blue-500{--tw-ring-color:var(--color-blue-500)}.ring-blue-500\\/40{--tw-ring-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.ring-blue-500\\/40{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.ring-zinc-800{--tw-ring-color:var(--color-zinc-800)}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-zinc-900{--tw-ring-offset-color:var(--color-zinc-900)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.brightness-\\[0\\.6\\]{--tw-brightness:brightness(.6);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.brightness-\\[0\\.85\\]{--tw-brightness:brightness(.85);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition-\\[border-color\\,opacity\\]{transition-property:border-color,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[filter\\]{transition-property:filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:border-dashed:is(:where(.group):hover *){--tw-border-style:dashed;border-style:dashed}.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\\:brightness-100:is(:where(.group):hover *){--tw-brightness:brightness(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.hover\\:scale-\\[1\\.02\\]:hover{scale:1.02}.hover\\:border-blue-500\\/30:hover{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/30:hover{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.hover\\:border-blue-500\\/40:hover{border-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/40:hover{border-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.hover\\:border-zinc-600:hover{border-color:var(--color-zinc-600)}.hover\\:border-zinc-700:hover{border-color:var(--color-zinc-700)}.hover\\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:#3080ff08}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:color-mix(in oklab,var(--color-blue-500)3%,transparent)}}.hover\\:bg-blue-600\\/20:hover{background-color:#155dfc33}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-600\\/20:hover{background-color:color-mix(in oklab,var(--color-blue-600)20%,transparent)}}.hover\\:bg-destructive\\/25:hover{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-destructive\\/25:hover{background-color:color-mix(in oklab,var(--color-destructive)25%,transparent)}}.hover\\:bg-primary\\/40:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/40:hover{background-color:color-mix(in oklab,var(--color-primary)40%,transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--color-primary)90%,transparent)}}.hover\\:bg-red-500\\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\\:bg-red-500\\/25:hover{background-color:#fb2c3640}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/25:hover{background-color:color-mix(in oklab,var(--color-red-500)25%,transparent)}}.hover\\:bg-white\\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/30:hover{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.hover\\:bg-zinc-600:hover{background-color:var(--color-zinc-600)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-800\\/40:hover{background-color:#27272a66}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/40:hover{background-color:color-mix(in oklab,var(--color-zinc-800)40%,transparent)}}.hover\\:bg-zinc-800\\/50:hover{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/50:hover{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-blue-400:hover{color:var(--color-blue-400)}.hover\\:text-destructive:hover{color:var(--color-destructive)}.hover\\:text-primary:hover{color:var(--color-primary)}.hover\\:text-red-200:hover{color:var(--color-red-200)}.hover\\:text-red-400:hover{color:var(--color-red-400)}.hover\\:text-red-500:hover{color:var(--color-red-500)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:text-zinc-200:hover{color:var(--color-zinc-200)}.hover\\:text-zinc-300:hover{color:var(--color-zinc-300)}.hover\\:text-zinc-400:hover{color:var(--color-zinc-400)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:ring-zinc-600:hover{--tw-ring-color:var(--color-zinc-600)}}.focus\\:bg-zinc-800:focus{background-color:var(--color-zinc-800)}.focus\\:text-white:focus{color:var(--color-white)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.focus\\:ring-blue-600:focus{--tw-ring-color:var(--color-blue-600)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:ring-offset-zinc-900:focus{--tw-ring-offset-color:var(--color-zinc-900)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-zinc-600:focus-visible{border-color:var(--color-zinc-600)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-blue-500:focus-visible{--tw-ring-color:var(--color-blue-500)}.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:#3080ffcc}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)80%,transparent)}}.focus-visible\\:ring-blue-600:focus-visible{--tw-ring-color:var(--color-blue-600)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\\:ring-offset-zinc-900:focus-visible{--tw-ring-offset-color:var(--color-zinc-900)}.focus-visible\\:ring-offset-zinc-950:focus-visible{--tw-ring-offset-color:var(--color-zinc-950)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-primary\\/60:active{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-primary\\/60:active{background-color:color-mix(in oklab,var(--color-primary)60%,transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-20:disabled{opacity:.2}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-50:disabled{opacity:.5}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=open\\]\\:border-zinc-800[data-state=open]{border-color:var(--color-zinc-800)}.data-\\[state\\=open\\]\\:bg-zinc-950[data-state=open]{background-color:var(--color-zinc-950)}.data-\\[state\\=open\\]\\:text-zinc-100[data-state=open]{color:var(--color-zinc-100)}@media(min-width:40rem){.sm\\:max-w-\\[280px\\]{max-width:280px}}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&\\>span\\]\\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\\[\\&\\>span\\]\\:flex>span{display:flex}.\\[\\&\\>span\\]\\:items-center>span{align-items:center}.\\[\\&\\>span\\]\\:gap-2>span{gap:calc(var(--spacing)*2)}}:root{--background:oklch(14.1% .005 285.823);--foreground:oklch(98.5% 0 0);--card:oklch(21% .006 285.885);--card-foreground:oklch(98.5% 0 0);--popover:oklch(21% .006 285.885);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(42% .18 266);--primary-foreground:oklch(97% .014 254.604);--secondary:oklch(27.4% .006 286.033);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27.4% .006 286.033);--muted-foreground:oklch(70.5% .015 286.067);--accent:oklch(42% .18 266);--accent-foreground:oklch(97% .014 254.604);--destructive:oklch(70.4% .191 22.216);--destructive-foreground:oklch(97% .014 254.604);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.2% .016 285.938);--radius:.5rem;--jp-inspector-label-size:11px;--jp-inspector-field-size:13px;font-family:ui-sans-serif,system-ui,sans-serif}[data-radix-portal]{z-index:9999!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}';class E0 extends N.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("[JsonPages Engine]",t,r)}render(){return this.state.hasError&&this.state.error?h.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,backgroundColor:"#0f172a",color:"#e2e8f0",fontFamily:"ui-sans-serif, system-ui, sans-serif"},children:[h.jsx("h1",{style:{fontSize:"1.25rem",fontWeight:700,marginBottom:8},children:"JsonPages Engine Error"}),h.jsx("pre",{style:{maxWidth:"100%",overflow:"auto",padding:16,backgroundColor:"rgba(0,0,0,0.3)",borderRadius:8,fontSize:12,marginTop:8},children:this.state.error.message})]}):this.props.children}}function Qn(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function Sc(e,t=""){const r=Qn(t);let o=e.replace(/\/+/g,"/");if(r){const s=`/${r}`;o===s?o="/":o.startsWith(`${s}/`)&&(o=o.slice(s.length))}return Qn(o)||"home"}function wi(e,t){const r=Qn(t)||"home";return e[r]}function yi(e,t){return rn(e,t)}const Cc=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,refDocuments:o,tenantCss:i,adminCss:s,NotFoundComponent:a})=>{const l=Ye.useLocation(),c=Sc(l.pathname),[d,f]=N.useState(null);N.useEffect(()=>{const v=document.getElementById("jp-baked-state");if(v!=null&&v.textContent)try{const k=JSON.parse(v.textContent);f(k),Fr.setTheme(k.theme)}catch(k){console.error("Failed to parse baked state",k)}},[]);const m=d?{[d.page.slug||c]:d.page}:e,p=d?d.site:t,w=d?d.menu:r,u=d?d.theme:n,g=N.useMemo(()=>Ut({pages:m,siteConfig:p,themeConfig:u,menuConfig:w,refDocuments:o}),[m,p,u,w,o]),b=d?g.pages[d.page.slug||c]:wi(g.pages,c);return N.useEffect(()=>{var v;try{(v=g.themeConfig)!=null&&v.tokens&&Fr.setTheme(g.themeConfig)}catch(k){console.warn("[JsonPages] visitor theme resolution failed",k)}},[g.themeConfig]),b?h.jsx(on,{mode:"tenant",tenantCss:i,adminCss:s,children:h.jsx(qr,{mode:"visitor",children:h.jsx(fo,{pageConfig:b,siteConfig:g.siteConfig,menuConfig:g.menuConfig})})}):h.jsx(a,{})},Ec=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,refDocuments:o,tenantCss:i,adminCss:s,addSectionConfig:a,addableSectionTypes:l,saveToFile:c,hotSave:d,showLegacySave:f=!0,showHotSave:m=!1,exportHTML:p})=>{var we;const w=Ye.useLocation(),u=Sc(w.pathname,"admin"),g=Ye.useNavigate(),b=Object.keys(e).sort((ee,oe)=>ee==="home"?-1:oe==="home"?1:ee.localeCompare(oe)),[v,k]=N.useState(null),[_,S]=N.useState(!1),[O,z]=N.useState(!1),[I,D]=N.useState(!1),[U,H]=N.useState(!1),[C,M]=N.useState(()=>{try{const ee=JSON.parse(JSON.stringify(t??{}));return ee.identity||(ee.identity={title:"Site"}),ee.pages||(ee.pages=[]),ee}catch{return{identity:{title:"Site"},pages:[]}}}),[y,L]=N.useState(null),[Q,F]=N.useState(null),[$,V]=N.useState(null),[re,A]=N.useState(null),[P,J]=N.useState(!1),[G,te]=N.useState(400),ce=N.useMemo(()=>Ut({pages:v?{[u]:v}:{},siteConfig:C,themeConfig:n,menuConfig:r,refDocuments:o}),[v,C,n,r,o,u]),q=v?ce.pages[u]??v:null,ie=N.useRef(v),ue=N.useRef(C),ae=360,pe=920;N.useEffect(()=>{ie.current=v},[v]),N.useEffect(()=>{ue.current=C},[C]);const ve=N.useCallback(ee=>{ee.preventDefault();const oe=ee.currentTarget;oe.setPointerCapture(ee.pointerId);const ge=ee.clientX,be=G,xe=Se=>{const Me=ge-Se.clientX,pt=Math.min(pe,Math.max(ae,be+Me));te(pt)},je=()=>{oe.releasePointerCapture(ee.pointerId),oe.removeEventListener("pointermove",xe),oe.removeEventListener("pointerup",je),oe.removeEventListener("pointercancel",je),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",oe.addEventListener("pointermove",xe),oe.addEventListener("pointerup",je),oe.addEventListener("pointercancel",je)},[G]),_e=v?[...C.header?[{id:C.header.id,type:C.header.type,scope:"global",title:"Header"}]:[],...v.sections.map(ee=>{var oe,ge;return{id:ee.id,type:ee.type,scope:"local",title:((oe=ee.data)==null?void 0:oe.title)??((ge=ee.data)==null?void 0:ge.titleHighlight)}}),...C.footer?[{id:C.footer.id,type:C.footer.type,scope:"global",title:"Footer"}]:[]]:[];N.useEffect(()=>{const ee=wi(e,u);ee&&k(JSON.parse(JSON.stringify(ee))),L(null),F(null),S(!1)},[u,e]);const x=N.useCallback(()=>{const ee=wi(e,u);ee&&k(JSON.parse(JSON.stringify(ee))),L(null),F(null),S(!1)},[u,e]),K=N.useCallback((ee,oe,ge)=>{const be=[...ge.sections],xe=be.findIndex(Me=>Me.id===ee);if(xe===-1||oe<0||oe>=be.length)return;const[je]=be.splice(xe,1),Se=oe>xe?oe-1:oe;be.splice(Math.min(Se,be.length),0,je),k({...ge,sections:be}),S(!0)},[]),W=N.useCallback(ee=>{var oe;if(ee.origin===window.location.origin){if(ee.data.type===Ae.SECTION_SELECT){L(ee.data.section);const ge=ee.data.itemPath;Array.isArray(ge)&&ge.length>0?F(ge.map(be=>({fieldKey:be.fieldKey,...be.itemId!=null?{itemId:String(be.itemId)}:{}}))):F(null)}if(ee.data.type===Ae.INLINE_FIELD_UPDATE){const ge=typeof ee.data.sectionId=="string"?ee.data.sectionId:null,be=typeof ee.data.fieldKey=="string"?ee.data.fieldKey:null;ge&&be&&(k(xe=>{if(!xe)return xe;const je={...xe,sections:xe.sections.map(Se=>Se.id===ge?{...Se,data:{...Se.data,[be]:ee.data.value}}:Se)};return ie.current=je,je}),S(!0))}if(ee.data.type===Ae.ACTIVE_SECTION_CHANGED&&V(ee.data.activeSectionId??null),ee.data.type==="jsonpages:section-reorder"&&ie.current){const{sectionId:ge,newIndex:be}=ee.data;typeof ge=="string"&&typeof be=="number"&&be>=0&&K(ge,be,ie.current)}if(ee.data.type===Ae.SEND_CLEAN_HTML){if(!ie.current)return;const ge=(oe=ce.siteConfig.header)==null?void 0:oe.data,be={page:ie.current,site:ue.current,menu:{main:yi(ge,r.main)},theme:ce.themeConfig};p(be,u,ee.data.html),S(!1)}}},[u,K,p,ce.siteConfig,ce.themeConfig,r.main]);N.useEffect(()=>(window.addEventListener("message",W),()=>window.removeEventListener("message",W)),[W]);const T=N.useCallback(ee=>{const oe=_e.find(ge=>ge.id===ee);oe&&L({id:oe.id,type:oe.type,scope:oe.scope}),F(null),A(ee)},[_e]),j=N.useCallback(()=>{A(null)},[]),R=N.useCallback(ee=>{k(oe=>oe&&{...oe,sections:oe.sections.filter(ge=>ge.id!==ee)}),S(!0),L(oe=>(oe==null?void 0:oe.id)===ee?null:oe)},[]),Y=ee=>{if(!(!y||!v))if(S(!0),y.scope==="global")y.type==="header"&&C.header!=null?M({...C,header:{...C.header,data:ee}}):y.type==="footer"&&C.footer!=null&&M({...C,footer:{...C.footer,data:ee}});else{const oe=v.sections.map(ge=>ge.id===y.id?{...ge,data:ee}:ge);k({...v,sections:oe})}},X=N.useCallback((ee,oe,ge,be)=>{var xe,je;if(S(!0),oe==="global")((xe=C.header)==null?void 0:xe.id)===ee?M({...C,header:{...C.header,data:be}}):((je=C.footer)==null?void 0:je.id)===ee&&M({...C,footer:{...C.footer,data:be}});else if(v){const Se=v.sections.map(Me=>Me.id===ee?{...Me,data:be}:Me);k({...v,sections:Se})}},[v,C]),B=()=>{var oe;const ee=document.querySelector("iframe");(oe=ee==null?void 0:ee.contentWindow)==null||oe.postMessage({type:Ae.REQUEST_CLEAN_HTML},"*")},ne=N.useCallback(async()=>{const ee=document.querySelector("iframe");if(!(ee!=null&&ee.contentWindow))return;const oe=crypto.randomUUID();await new Promise(ge=>{var je;let be=!1;const xe=Se=>{var Me,pt;Se.origin===window.location.origin&&((Me=Se.data)==null?void 0:Me.type)===Ae.INLINE_FLUSHED&&((pt=Se.data)==null?void 0:pt.requestId)===oe&&(be=!0,window.removeEventListener("message",xe),ge())};window.addEventListener("message",xe),(je=ee.contentWindow)==null||je.postMessage({type:Ae.REQUEST_INLINE_FLUSH,requestId:oe},"*"),window.setTimeout(()=>{be||(window.removeEventListener("message",xe),ge())},400)})},[]),fe=async()=>{var je;if(!c)return;await ne();const ee=ie.current,oe=ue.current;if(!ee)return;const ge=Ut({pages:{[u]:ee},siteConfig:oe,themeConfig:n,menuConfig:r,refDocuments:o}),be=(je=ge.siteConfig.header)==null?void 0:je.data,xe={page:ee,site:oe,menu:{main:yi(be,r.main)},theme:ge.themeConfig};c(xe,u).then(()=>{S(!1),z(!0),typeof window<"u"&&window.setTimeout(()=>z(!1),2500)}).catch(Se=>{console.error("[JsonPages] saveToFile failed",Se);const Me=Se instanceof Error?Se.message:String(Se);alert(`Save to file failed: ${Me}`)})},se=async()=>{var je;if(!d)return;await ne();const ee=ie.current,oe=ue.current;if(!ee)return;const ge=Ut({pages:{[u]:ee},siteConfig:oe,themeConfig:n,menuConfig:r,refDocuments:o}),be=(je=ge.siteConfig.header)==null?void 0:je.data,xe={page:ee,site:oe,menu:{main:yi(be,r.main)},theme:ge.themeConfig};H(!0),d(xe,u).then(()=>{S(!1),D(!0),typeof window<"u"&&window.setTimeout(()=>D(!1),2500)}).catch(Se=>{console.error("[JsonPages] hotSave failed",Se);const Me=Se instanceof Error?Se.message:String(Se);alert(`Hot save failed: ${Me}`)}).finally(()=>{H(!1)})},Z=ee=>{var be;if(!v)return;const oe=((be=a==null?void 0:a.getDefaultSectionData)==null?void 0:be.call(a,ee))??{},ge={id:crypto.randomUUID(),type:ee,data:oe,settings:void 0};k({...v,sections:[...v.sections,ge]}),S(!0),L({id:ge.id,type:ee,scope:"local"})};if(!v)return h.jsx("div",{children:"Loading Studio..."});const de=(y==null?void 0:y.scope)==="global"?{sections:[ce.siteConfig.header,ce.siteConfig.footer].filter(ee=>ee!=null)}:q??v,le=[...ce.siteConfig.header?[ce.siteConfig.header]:[],...((we=q??v)==null?void 0:we.sections)??[],...ce.siteConfig.footer?[ce.siteConfig.footer]:[]];return h.jsx(on,{mode:"admin",tenantCss:i,adminCss:s,children:h.jsx(qr,{mode:"studio",children:h.jsxs("div",{className:"flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden",children:[h.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[h.jsx("main",{className:"flex-1 min-w-0 relative bg-zinc-900/50 overflow-hidden",children:h.jsx(vc,{draft:q??v,globalDraft:ce.siteConfig,menuConfig:ce.menuConfig,themeConfig:ce.themeConfig,slug:u,selectedId:y==null?void 0:y.id,scrollToSectionId:re,onScrollRequested:j})}),h.jsxs("div",{className:"flex shrink-0 relative h-full z-10",style:{width:G,minWidth:ae,maxWidth:pe},children:[h.jsx("div",{role:"separator","aria-label":"Resize inspector",className:"absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-primary/40 active:bg-primary/60 transition-colors shrink-0",style:{zIndex:9999},onPointerDown:ve}),h.jsx(bc,{selectedSection:y,pageData:de,allSectionsData:le,onUpdate:Y,onUpdateSection:X,onClose:()=>{L(null),F(null)},expandedItemPath:Q,onReorderSection:v?(ee,oe)=>K(ee,oe,v):void 0,allLayers:_e,activeSectionId:$,onRequestScrollToSection:T,onDeleteSection:v?R:void 0,onAddSection:l.length>0?()=>J(!0):void 0,hasChanges:_,onExportHTML:B,onSaveToFile:c!=null?fe:void 0,saveSuccessFeedback:O,onHotSave:d!=null?se:void 0,hotSaveSuccessFeedback:I,hotSaveInProgress:U,showLegacySave:f,showHotSave:m,onResetToFile:x,pageSlugs:b,currentSlug:u,onPageChange:b.length>1?ee=>{const oe=Qn(ee);g(oe==="home"?"/admin":`/admin/${oe}`)}:void 0})]})]}),h.jsx(kc,{open:P,onClose:()=>J(!1),sectionTypes:l,sectionTypeLabels:a==null?void 0:a.sectionTypeLabels,onSelect:Z})]})})})},Nc=({tenantCss:e,adminCss:t})=>h.jsx(on,{mode:"tenant",tenantCss:e,adminCss:t,children:h.jsx(yc,{})});function N0({config:e}){var v,k,_,S,O,z;const{registry:t={},schemas:r={},pages:n={},siteConfig:o,themeConfig:i,menuConfig:s,refDocuments:a,themeCss:l,addSection:c,NotFoundComponent:d=_c}=e,f=(c==null?void 0:c.addableSectionTypes)??Object.keys(r).filter(I=>I!=="header"&&I!=="footer"),m={exportJSON:((v=e.persistence)==null?void 0:v.exportJSON)??Ai,exportHTML:((k=e.persistence)==null?void 0:k.exportHTML)??Ti,saveToFile:(_=e.persistence)==null?void 0:_.saveToFile,hotSave:(S=e.persistence)==null?void 0:S.hotSave,showLegacySave:((O=e.persistence)==null?void 0:O.showLegacySave)??!0,showHotSave:((z=e.persistence)==null?void 0:z.showHotSave)??!1},p=typeof(l==null?void 0:l.tenant)=="string"?l.tenant:"",w=typeof(l==null?void 0:l.admin)=="string"?l.admin:C0,u=N.useMemo(()=>Ut({pages:n,siteConfig:o,themeConfig:i,menuConfig:s,refDocuments:a}),[n,o,i,s,a]),[g,b]=N.useState(!1);return N.useEffect(()=>{var I;try{(I=u.themeConfig)!=null&&I.tokens&&Fr.setTheme(u.themeConfig)}catch(D){console.warn("[JsonPages] setTheme failed",D)}b(!0)},[u.themeConfig]),g?h.jsx(E0,{children:h.jsx(es,{config:{registry:t,schemas:r,tenantId:e.tenantId??"default",assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:h.jsx(Ye.BrowserRouter,{children:h.jsxs(Ye.Routes,{children:[h.jsx(Ye.Route,{path:"/",element:h.jsx(Cc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:u.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,NotFoundComponent:d})}),h.jsx(Ye.Route,{path:"/*",element:h.jsx(Cc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:u.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,NotFoundComponent:d})}),h.jsx(Ye.Route,{path:"/admin",element:h.jsx(Ec,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:u.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,addSectionConfig:c,addableSectionTypes:f,saveToFile:m.saveToFile,hotSave:m.hotSave,showLegacySave:m.showLegacySave,showHotSave:m.showHotSave,exportHTML:m.exportHTML})}),h.jsx(Ye.Route,{path:"/admin/*",element:h.jsx(Ec,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:u.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,addSectionConfig:c,addableSectionTypes:f,saveToFile:m.saveToFile,hotSave:m.hotSave,showLegacySave:m.showLegacySave,showHotSave:m.showHotSave,exportHTML:m.exportHTML})}),h.jsx(Ye.Route,{path:"/admin/preview",element:h.jsx(Nc,{tenantCss:p,adminCss:w})}),h.jsx(Ye.Route,{path:"/admin/preview/*",element:h.jsx(Nc,{tenantCss:p,adminCss:w})}),h.jsx(Ye.Route,{path:"*",element:h.jsx(d,{})})]})})})}):h.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#0f172a",color:"#94a3b8",fontFamily:"ui-sans-serif, system-ui, sans-serif",fontSize:14},children:"Loading..."})}const z0=({hasChanges:e,onExportJSON:t,onExportHTML:r,onAddSection:n})=>h.jsxs("div",{className:"h-14 border-b border-zinc-800 bg-zinc-950 flex items-center justify-between px-6 shrink-0 z-50 relative",children:[h.jsx("div",{className:"flex items-center gap-3",children:n!=null&&h.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-2 px-3 py-1.5 rounded-md text-xs font-medium border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600 transition-colors",title:"Add section","aria-label":"Add section",children:[h.jsx(Wd,{size:14}),h.jsx("span",{children:"Add section"})]})}),h.jsx("div",{className:"absolute left-1/2 -translate-x-1/2 opacity-20 pointer-events-none",children:h.jsx("span",{className:"text-xs font-black tracking-[0.2em] text-zinc-100",children:"JSONPAGES STUDIO"})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("button",{onClick:r,className:"flex items-center gap-2 px-3 py-1.5 rounded-md text-xs font-medium transition-all border bg-zinc-900 border-zinc-700 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",children:[h.jsx(Pd,{size:14}),h.jsx("span",{children:"Bake HTML"})]}),h.jsxs("button",{onClick:t,disabled:!e,className:ye("flex items-center gap-2 px-4 py-1.5 rounded-md text-xs font-bold transition-all shadow-lg",e?"bg-blue-600 text-white hover:bg-blue-500 shadow-blue-900/20":"bg-zinc-900 text-zinc-600 cursor-not-allowed"),children:[h.jsx(Dd,{size:14}),h.jsx("span",{children:"Export JSON"})]})]})]});Ce.AddSectionLibrary=kc,Ce.AdminSidebar=bc,Ce.ConfigProvider=es,Ce.ControlBar=z0,Ce.DefaultNotFound=_c,Ce.FormFactory=Or,Ce.InputWidgets=nr,Ce.JsonPagesEngine=N0,Ce.PageRenderer=fo,Ce.PreviewEntry=yc,Ce.STUDIO_EVENTS=Ae,Ce.SectionRenderer=pr,Ce.StudioProvider=qr,Ce.StudioStage=vc,Ce.ThemeLoader=on,Ce.cn=ye,Ce.exportBakedHTML=Ti,Ce.exportProjectJSON=Ai,Ce.resolveAssetUrl=Hl,Ce.resolveHeaderMenuItems=rn,Ce.resolveRuntimeConfig=Ut,Ce.resolveSectionMenuItems=nn,Ce.shouldRenderSiteGlobalHeader=Ei,Ce.themeManager=Fr,Ce.useConfig=fr,Ce.useStudio=rs,Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"})}));
226
+ `)},Dm=0,nr=[];function _m(e){var t=g.useRef([]),r=g.useRef([0,0]),n=g.useRef(),o=g.useState(Dm++)[0],i=g.useState(Ja)[0],s=g.useRef(e);g.useEffect(function(){s.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=rm([e.lockRef.current],(e.shards||[]).map(ol),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=g.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!s.current.allowPinchZoom;var y=Wn(m),k=r.current,x="deltaX"in m?m.deltaX:k[0]-y[0],S="deltaY"in m?m.deltaY:k[1]-y[1],C,E=m.target,j=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&j==="h"&&E.type==="range")return!1;var N=window.getSelection(),_=N&&N.anchorNode,R=_?_===E||_.contains(E):!1;if(R)return!1;var I=el(j,E);if(!I)return!0;if(I?C=j:(C=j==="v"?"h":"v",I=el(j,E)),!I)return!1;if(!n.current&&"changedTouches"in m&&(x||S)&&(n.current=C),!C)return!0;var L=n.current||C;return Pm(L,v,m,L==="h"?x:S)},[]),l=g.useCallback(function(m){var v=m;if(!(!nr.length||nr[nr.length-1]!==i)){var y="deltaY"in v?nl(v):Wn(v),k=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&Om(C.delta,y)})[0];if(k&&k.should){v.cancelable&&v.preventDefault();return}if(!k){var x=(s.current.shards||[]).map(ol).filter(Boolean).filter(function(C){return C.contains(v.target)}),S=x.length>0?a(v,x[0]):!s.current.noIsolation;S&&v.cancelable&&v.preventDefault()}}},[]),d=g.useCallback(function(m,v,y,k){var x={name:m,delta:v,target:y,should:k,shadowParent:Mm(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),u=g.useCallback(function(m){r.current=Wn(m),n.current=void 0},[]),f=g.useCallback(function(m){d(m.type,nl(m),m.target,a(m,e.lockRef.current))},[]),h=g.useCallback(function(m){d(m.type,Wn(m),m.target,a(m,e.lockRef.current))},[]);g.useEffect(function(){return nr.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,rr),document.addEventListener("touchmove",l,rr),document.addEventListener("touchstart",u,rr),function(){nr=nr.filter(function(m){return m!==i}),document.removeEventListener("wheel",l,rr),document.removeEventListener("touchmove",l,rr),document.removeEventListener("touchstart",u,rr)}},[]);var p=e.removeScrollBar,w=e.inert;return g.createElement(g.Fragment,null,w?g.createElement(i,{styles:Im(o)}):null,p?g.createElement(Cm,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Mm(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Rm=um(Xa,_m);var ei=g.forwardRef(function(e,t){return g.createElement($n,dt({},e,{ref:t,sideCar:Rm}))});ei.classNames=$n.classNames;var Lm=[" ","Enter","ArrowUp","ArrowDown"],$m=[" ","Enter"],Rt="Select",[Un,Bn,Fm]=op(Rt),[or]=Ar(Rt,[Fm,Qt]),Hn=Qt(),[Wm,Ct]=or(Rt),[Um,Bm]=or(Rt),il=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:d,name:u,autoComplete:f,disabled:h,required:p,form:w}=e,m=Hn(t),[v,y]=g.useState(null),[k,x]=g.useState(null),[S,C]=g.useState(!1),E=sp(d),[j,N]=Dn({prop:n,defaultProp:o??!1,onChange:i,caller:Rt}),[_,R]=Dn({prop:s,defaultProp:a,onChange:l,caller:Rt}),I=g.useRef(null),L=v?w||!!v.closest("form"):!0,[M,Y]=g.useState(new Set),H=Array.from(M).map(U=>U.props.value).join(";");return c.jsx(Ko,{...m,children:c.jsxs(Wm,{required:p,scope:t,trigger:v,onTriggerChange:y,valueNode:k,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:Tr(),value:_,onValueChange:R,open:j,onOpenChange:N,dir:E,triggerPointerDownPosRef:I,disabled:h,children:[c.jsx(Un.Provider,{scope:t,children:c.jsx(Um,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(U=>{Y(B=>new Set(B).add(U))},[]),onNativeOptionRemove:g.useCallback(U=>{Y(B=>{const T=new Set(B);return T.delete(U),T})},[]),children:r})}),L?c.jsxs(El,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:_,onChange:U=>R(U.target.value),disabled:h,form:w,children:[_===void 0?c.jsx("option",{value:""}):null,Array.from(M)]},H):null]})})};il.displayName=Rt;var sl="SelectTrigger",al=g.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...o}=e,i=Hn(r),s=Ct(sl,r),a=s.disabled||n,l=ke(t,s.onTriggerChange),d=Bn(r),u=g.useRef("touch"),[f,h,p]=jl(m=>{const v=d().filter(x=>!x.disabled),y=v.find(x=>x.value===s.value),k=Al(v,m,y);k!==void 0&&s.onValueChange(k.value)}),w=m=>{a||(s.onOpenChange(!0),p()),m&&(s.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return c.jsx(On,{asChild:!0,...i,children:c.jsx(we.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Nl(s.value)?"":void 0,...o,ref:l,onClick:pe(o.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&w(m)}),onPointerDown:pe(o.onPointerDown,m=>{u.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(w(m),m.preventDefault())}),onKeyDown:pe(o.onKeyDown,m=>{const v=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&h(m.key),!(v&&m.key===" ")&&Lm.includes(m.key)&&(w(),m.preventDefault())})})})});al.displayName=sl;var ll="SelectValue",cl=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:s="",...a}=e,l=Ct(ll,r),{onValueNodeHasChildrenChange:d}=l,u=i!==void 0,f=ke(t,l.onValueNodeChange);return Me(()=>{d(u)},[d,u]),c.jsx(we.span,{...a,ref:f,style:{pointerEvents:"none"},children:Nl(l.value)?c.jsx(c.Fragment,{children:s}):i})});cl.displayName=ll;var Hm="SelectIcon",dl=g.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return c.jsx(we.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});dl.displayName=Hm;var Vm="SelectPortal",ul=e=>c.jsx(In,{asChild:!0,...e});ul.displayName=Vm;var Lt="SelectContent",fl=g.forwardRef((e,t)=>{const r=Ct(Lt,e.__scopeSelect),[n,o]=g.useState();if(Me(()=>{o(new DocumentFragment)},[]),!r.open){const i=n;return i?Vr.createPortal(c.jsx(pl,{scope:e.__scopeSelect,children:c.jsx(Un.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),i):null}return c.jsx(hl,{...e,ref:t})});fl.displayName=Lt;var nt=10,[pl,Et]=or(Lt),Km="SelectContentImpl",Gm=Yt("SelectContent.RemoveScroll"),hl=g.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:m,avoidCollisions:v,...y}=e,k=Ct(Lt,r),[x,S]=g.useState(null),[C,E]=g.useState(null),j=ke(t,P=>S(P)),[N,_]=g.useState(null),[R,I]=g.useState(null),L=Bn(r),[M,Y]=g.useState(!1),H=g.useRef(!1);g.useEffect(()=>{if(x)return Ka(x)},[x]),oa();const U=g.useCallback(P=>{const[J,...te]=L().map(Q=>Q.ref.current),[F]=te.slice(-1),ne=document.activeElement;for(const Q of P)if(Q===ne||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===J&&C&&(C.scrollTop=0),Q===F&&C&&(C.scrollTop=C.scrollHeight),Q==null||Q.focus(),document.activeElement!==ne))return},[L,C]),B=g.useCallback(()=>U([N,x]),[U,N,x]);g.useEffect(()=>{M&&B()},[M,B]);const{onOpenChange:T,triggerPointerDownPosRef:X}=k;g.useEffect(()=>{if(x){let P={x:0,y:0};const J=F=>{var ne,Q;P={x:Math.abs(Math.round(F.pageX)-(((ne=X.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(F.pageY)-(((Q=X.current)==null?void 0:Q.y)??0))}},te=F=>{P.x<=10&&P.y<=10?F.preventDefault():x.contains(F.target)||T(!1),document.removeEventListener("pointermove",J),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",te,{capture:!0})}}},[x,T,X]),g.useEffect(()=>{const P=()=>T(!1);return window.addEventListener("blur",P),window.addEventListener("resize",P),()=>{window.removeEventListener("blur",P),window.removeEventListener("resize",P)}},[T]);const[re,A]=jl(P=>{const J=L().filter(ne=>!ne.disabled),te=J.find(ne=>ne.ref.current===document.activeElement),F=Al(J,P,te);F&&setTimeout(()=>F.ref.current.focus())}),W=g.useCallback((P,J,te)=>{const F=!H.current&&!te;(k.value!==void 0&&k.value===J||F)&&(_(P),F&&(H.current=!0))},[k.value]),q=g.useCallback(()=>x==null?void 0:x.focus(),[x]),G=g.useCallback((P,J,te)=>{const F=!H.current&&!te;(k.value!==void 0&&k.value===J||F)&&I(P)},[k.value]),me=n==="popper"?ti:ml,se=me===ti?{side:a,sideOffset:l,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:h,collisionPadding:p,sticky:w,hideWhenDetached:m,avoidCollisions:v}:{};return c.jsx(pl,{scope:r,content:x,viewport:C,onViewportChange:E,itemRefCallback:W,selectedItem:N,onItemLeave:q,itemTextRefCallback:G,focusSelectedItem:B,selectedItemText:R,position:n,isPositioned:M,searchRef:re,children:c.jsx(ei,{as:Gm,allowPinchZoom:!0,children:c.jsx(Oo,{asChild:!0,trapped:k.open,onMountAutoFocus:P=>{P.preventDefault()},onUnmountAutoFocus:pe(o,P=>{var J;(J=k.trigger)==null||J.focus({preventScroll:!0}),P.preventDefault()}),children:c.jsx(yn,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:P=>P.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:c.jsx(me,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:P=>P.preventDefault(),...y,...se,onPlaced:()=>Y(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:pe(y.onKeyDown,P=>{const J=P.ctrlKey||P.altKey||P.metaKey;if(P.key==="Tab"&&P.preventDefault(),!J&&P.key.length===1&&A(P.key),["ArrowUp","ArrowDown","Home","End"].includes(P.key)){let F=L().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(P.key)&&(F=F.slice().reverse()),["ArrowUp","ArrowDown"].includes(P.key)){const ne=P.target,Q=F.indexOf(ne);F=F.slice(Q+1)}setTimeout(()=>U(F)),P.preventDefault()}})})})})})})});hl.displayName=Km;var Ym="SelectItemAlignedPosition",ml=g.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...o}=e,i=Ct(Lt,r),s=Et(Lt,r),[a,l]=g.useState(null),[d,u]=g.useState(null),f=ke(t,j=>u(j)),h=Bn(r),p=g.useRef(!1),w=g.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:y,focusSelectedItem:k}=s,x=g.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&d&&m&&v&&y){const j=i.trigger.getBoundingClientRect(),N=d.getBoundingClientRect(),_=i.valueNode.getBoundingClientRect(),R=y.getBoundingClientRect();if(i.dir!=="rtl"){const ne=R.left-N.left,Q=_.left-ne,xe=j.left-Q,ge=j.width+xe,ze=Math.max(ge,N.width),Oe=window.innerWidth-nt,Be=Xs(Q,[nt,Math.max(nt,Oe-ze)]);a.style.minWidth=ge+"px",a.style.left=Be+"px"}else{const ne=N.right-R.right,Q=window.innerWidth-_.right-ne,xe=window.innerWidth-j.right-Q,ge=j.width+xe,ze=Math.max(ge,N.width),Oe=window.innerWidth-nt,Be=Xs(Q,[nt,Math.max(nt,Oe-ze)]);a.style.minWidth=ge+"px",a.style.right=Be+"px"}const I=h(),L=window.innerHeight-nt*2,M=m.scrollHeight,Y=window.getComputedStyle(d),H=parseInt(Y.borderTopWidth,10),U=parseInt(Y.paddingTop,10),B=parseInt(Y.borderBottomWidth,10),T=parseInt(Y.paddingBottom,10),X=H+U+M+T+B,re=Math.min(v.offsetHeight*5,X),A=window.getComputedStyle(m),W=parseInt(A.paddingTop,10),q=parseInt(A.paddingBottom,10),G=j.top+j.height/2-nt,me=L-G,se=v.offsetHeight/2,P=v.offsetTop+se,J=H+U+P,te=X-J;if(J<=G){const ne=I.length>0&&v===I[I.length-1].ref.current;a.style.bottom="0px";const Q=d.clientHeight-m.offsetTop-m.offsetHeight,xe=Math.max(me,se+(ne?q:0)+Q+B),ge=J+xe;a.style.height=ge+"px"}else{const ne=I.length>0&&v===I[0].ref.current;a.style.top="0px";const xe=Math.max(G,H+m.offsetTop+(ne?W:0)+se)+te;a.style.height=xe+"px",m.scrollTop=J-G+m.offsetTop}a.style.margin=`${nt}px 0`,a.style.minHeight=re+"px",a.style.maxHeight=L+"px",n==null||n(),requestAnimationFrame(()=>p.current=!0)}},[h,i.trigger,i.valueNode,a,d,m,v,y,i.dir,n]);Me(()=>x(),[x]);const[S,C]=g.useState();Me(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const E=g.useCallback(j=>{j&&w.current===!0&&(x(),k==null||k(),w.current=!1)},[x,k]);return c.jsx(Xm,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:E,children:c.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:c.jsx(we.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});ml.displayName=Ym;var qm="SelectPopperPosition",ti=g.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=nt,...i}=e,s=Hn(r);return c.jsx(Go,{...s,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});ti.displayName=qm;var[Xm,ri]=or(Lt,{}),ni="SelectViewport",gl=g.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...o}=e,i=Et(ni,r),s=ri(ni,r),a=ke(t,i.onViewportChange),l=g.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),c.jsx(Un.Slot,{scope:r,children:c.jsx(we.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:pe(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=s;if(h!=null&&h.current&&f){const p=Math.abs(l.current-u.scrollTop);if(p>0){const w=window.innerHeight-nt*2,m=parseFloat(f.style.minHeight),v=parseFloat(f.style.height),y=Math.max(m,v);if(y<w){const k=y+p,x=Math.min(w,k),S=k-x;f.style.height=x+"px",f.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});gl.displayName=ni;var bl="SelectGroup",[Jm,Zm]=or(bl),Qm=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Tr();return c.jsx(Jm,{scope:r,id:o,children:c.jsx(we.div,{role:"group","aria-labelledby":o,...n,ref:t})})});Qm.displayName=bl;var vl="SelectLabel",eg=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Zm(vl,r);return c.jsx(we.div,{id:o.id,...n,ref:t})});eg.displayName=vl;var Vn="SelectItem",[tg,xl]=or(Vn),wl=g.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,...s}=e,a=Ct(Vn,r),l=Et(Vn,r),d=a.value===n,[u,f]=g.useState(i??""),[h,p]=g.useState(!1),w=ke(t,k=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,k,n,o)}),m=Tr(),v=g.useRef("touch"),y=()=>{o||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(tg,{scope:r,value:n,disabled:o,textId:m,isSelected:d,onItemTextChange:g.useCallback(k=>{f(x=>x||((k==null?void 0:k.textContent)??"").trim())},[]),children:c.jsx(Un.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:c.jsx(we.div,{role:"option","aria-labelledby":m,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:w,onFocus:pe(s.onFocus,()=>p(!0)),onBlur:pe(s.onBlur,()=>p(!1)),onClick:pe(s.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:pe(s.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:pe(s.onPointerDown,k=>{v.current=k.pointerType}),onPointerMove:pe(s.onPointerMove,k=>{var x;v.current=k.pointerType,o?(x=l.onItemLeave)==null||x.call(l):v.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:pe(s.onPointerLeave,k=>{var x;k.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:pe(s.onKeyDown,k=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&k.key===" "||($m.includes(k.key)&&y(),k.key===" "&&k.preventDefault())})})})})});wl.displayName=Vn;var Or="SelectItemText",yl=g.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:o,...i}=e,s=Ct(Or,r),a=Et(Or,r),l=xl(Or,r),d=Bm(Or,r),[u,f]=g.useState(null),h=ke(t,y=>f(y),l.onItemTextChange,y=>{var k;return(k=a.itemTextRefCallback)==null?void 0:k.call(a,y,l.value,l.disabled)}),p=u==null?void 0:u.textContent,w=g.useMemo(()=>c.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=d;return Me(()=>(m(w),()=>v(w)),[m,v,w]),c.jsxs(c.Fragment,{children:[c.jsx(we.span,{id:l.textId,...i,ref:h}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Vr.createPortal(i.children,s.valueNode):null]})});yl.displayName=Or;var kl="SelectItemIndicator",Sl=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return xl(kl,r).isSelected?c.jsx(we.span,{"aria-hidden":!0,...n,ref:t}):null});Sl.displayName=kl;var oi="SelectScrollUpButton",rg=g.forwardRef((e,t)=>{const r=Et(oi,e.__scopeSelect),n=ri(oi,e.__scopeSelect),[o,i]=g.useState(!1),s=ke(t,n.onScrollButtonChange);return Me(()=>{if(r.viewport&&r.isPositioned){let a=function(){const d=l.scrollTop>0;i(d)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?c.jsx(Cl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});rg.displayName=oi;var ii="SelectScrollDownButton",ng=g.forwardRef((e,t)=>{const r=Et(ii,e.__scopeSelect),n=ri(ii,e.__scopeSelect),[o,i]=g.useState(!1),s=ke(t,n.onScrollButtonChange);return Me(()=>{if(r.viewport&&r.isPositioned){let a=function(){const d=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<d;i(u)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),o?c.jsx(Cl,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});ng.displayName=ii;var Cl=g.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...o}=e,i=Et("SelectScrollButton",r),s=g.useRef(null),a=Bn(r),l=g.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return g.useEffect(()=>()=>l(),[l]),Me(()=>{var u;const d=a().find(f=>f.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),c.jsx(we.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:pe(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:pe(o.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:pe(o.onPointerLeave,()=>{l()})})}),og="SelectSeparator",ig=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return c.jsx(we.div,{"aria-hidden":!0,...n,ref:t})});ig.displayName=og;var si="SelectArrow",sg=g.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,o=Hn(r),i=Ct(si,r),s=Et(si,r);return i.open&&s.position==="popper"?c.jsx(Yo,{...o,...n,ref:t}):null});sg.displayName=si;var ag="SelectBubbleInput",El=g.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const o=g.useRef(null),i=ke(n,o),s=Xh(t);return g.useEffect(()=>{const a=o.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==t&&u){const f=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(f)}},[s,t]),c.jsx(we.select,{...r,style:{...Ba,...r.style},ref:i,defaultValue:t})});El.displayName=ag;function Nl(e){return e===""||e===void 0}function jl(e){const t=_t(e),r=g.useRef(""),n=g.useRef(0),o=g.useCallback(s=>{const a=r.current+s;t(a),(function l(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>l(""),1e3))})(a)},[t]),i=g.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,i]}function Al(e,t,r){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let s=lg(e,Math.max(i,0));o.length===1&&(s=s.filter(d=>d!==r));const l=s.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==r?l:void 0}function lg(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var cg=il,Tl=al,dg=cl,ug=dl,fg=ul,zl=fl,pg=gl,Pl=wl,hg=yl,mg=Sl;const gg=cg,bg=dg,Ol=g.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Tl,{ref:n,className:oe("flex h-8 w-full items-center justify-between gap-2 rounded-md border border-zinc-800 bg-black px-3 py-1.5 text-left text-xs font-medium text-white outline-none","hover:bg-zinc-900 focus-visible:ring-2 focus-visible:ring-blue-500/80 focus-visible:ring-inset focus-visible:border-zinc-600","disabled:pointer-events-none disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:flex [&>span]:items-center [&>span]:gap-2",e),style:{boxShadow:"none",WebkitBoxShadow:"none",MozBoxShadow:"none"},...r,children:[t,c.jsx(ug,{asChild:!0,children:c.jsx(Jr,{className:"h-3 w-3 shrink-0 text-zinc-400",strokeWidth:2})})]}));Ol.displayName=Tl.displayName;const Il=g.forwardRef(({className:e,children:t,position:r="popper",...n},o)=>c.jsx(fg,{children:c.jsx(zl,{ref:o,className:oe("relative z-[9999] max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-zinc-800 bg-zinc-950 text-white shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:c.jsx(pg,{className:oe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));Il.displayName=zl.displayName;const Dl=g.forwardRef(({className:e,children:t,...r},n)=>c.jsxs(Pl,{ref:n,className:oe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-xs outline-none","focus:bg-zinc-800 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[c.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(mg,{children:c.jsx(io,{className:"h-3 w-3",strokeWidth:2})})}),c.jsx(hg,{children:t})]}));Dl.displayName=Pl.displayName;const _l=g.createContext(null);function Ml(){const e=g.useContext(_l);if(!e)throw new Error("Dialog components must be used within Dialog");return e}function Rl({open:e,onOpenChange:t,children:r}){const[n,o]=g.useState(!1),i=e!==void 0,s=i?e:n,a=g.useCallback(d=>{i||o(d),t==null||t(d)},[i,t]),l=g.useMemo(()=>({open:s,onOpenChange:a}),[s,a]);return c.jsx(_l.Provider,{value:l,children:r})}function vg({asChild:e,children:t}){const{onOpenChange:r}=Ml(),n=g.Children.only(t);return e&&g.isValidElement(n)?g.cloneElement(n,{onClick:o=>{var i,s;(s=(i=n.props).onClick)==null||s.call(i,o),r(!0)}}):c.jsx("button",{type:"button",onClick:()=>r(!0),children:t})}function Ll({className:e,children:t,preventCloseOnBackdropClick:r,...n}){const{open:o,onOpenChange:i}=Ml();if(g.useEffect(()=>{const a=l=>{l.key==="Escape"&&i(!1)};return o&&(document.addEventListener("keydown",a),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",a),document.body.style.overflow=""}},[o,i]),!o)return null;const s=a=>{a.preventDefault(),a.stopPropagation()};return bt.createPortal(c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 z-[9998] bg-black/60","aria-hidden":!0,onClick:()=>!r&&i(!1),onDragOver:s,onDrop:s}),c.jsx("div",{role:"dialog","aria-modal":!0,className:oe("fixed left-1/2 top-1/2 z-[9999] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border border-zinc-700 bg-zinc-900 p-4 shadow-xl",e),onClick:a=>a.stopPropagation(),...n,children:t})]}),document.body)}function $l({className:e,...t}){return c.jsx("div",{className:oe("flex flex-col gap-1.5 pb-4",e),...t})}function xg({className:e,...t}){return c.jsx("div",{className:oe("flex justify-end gap-2 pt-4",e),...t})}function Fl({className:e,...t}){return c.jsx("h2",{className:oe("text-sm font-semibold text-white",e),...t})}function Wl({className:e,...t}){return c.jsx("p",{className:oe("text-xs text-zinc-400",e),...t})}const qe=g.forwardRef(({className:e,variant:t="default",size:r="default",asChild:n=!1,...o},i)=>{const s="inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:shrink-0 cursor-pointer",a={default:"bg-primary text-primary-foreground shadow-lg shadow-primary/20 hover:bg-primary/90",outline:"border border-zinc-700 bg-zinc-900 text-zinc-200 hover:bg-zinc-800 hover:border-zinc-600",ghost:"text-zinc-500 hover:text-zinc-200 hover:bg-zinc-800",destructive:"bg-destructive/15 text-destructive hover:bg-destructive/25"},l={sm:"h-7 px-2.5 text-[11px]",default:"h-8 px-3 py-1.5 text-xs",lg:"h-9 px-5 text-sm",icon:"h-8 w-8","icon-sm":"h-7 w-7","icon-xs":"h-6 w-6"},d=n?Zf:"button";return c.jsx(d,{ref:i,type:"button",className:oe(s,a[t],l[r],e),...o})});qe.displayName="Button";const wg=["library","upload","url"];function yg({library:e,selectedId:t,onSelect:r}){const[n,o]=b.useState(""),[i,s]=b.useState("all"),a=["all",...new Set(e.flatMap(d=>d.tags??[]))],l=e.filter(d=>{const u=i==="all"||(d.tags??[]).includes(i),f=!n||(d.alt??"").toLowerCase().includes(n.toLowerCase());return u&&f});return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"relative",children:[c.jsx(Ld,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-zinc-600 pointer-events-none"}),c.jsx(jo,{value:n,onChange:d=>o(d.target.value),placeholder:"Cerca immagini...",className:"pl-9 h-8 text-xs bg-zinc-900/50 border-zinc-800"})]}),c.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.map(d=>c.jsx("button",{type:"button",onClick:()=>s(d),className:oe("px-2.5 py-1 rounded text-[10px] font-medium border transition-colors",i===d?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-700 text-zinc-500 hover:border-zinc-600 hover:text-zinc-400"),children:d==="all"?"Tutte":d},d))}),l.length>0?c.jsx("div",{className:"grid grid-cols-3 gap-2.5 max-h-[45vh] overflow-y-auto",children:l.map(d=>{const u=t===d.id;return c.jsxs("button",{type:"button",onClick:()=>r(u?null:d.id),className:oe("group relative aspect-[4/3] rounded-lg overflow-hidden","ring-1 transition-all duration-150",u?"ring-blue-500 ring-2 ring-offset-1 ring-offset-zinc-900":"ring-zinc-800 hover:ring-zinc-600 hover:scale-[1.02]"),children:[c.jsx("img",{src:d.url,alt:d.alt,loading:"lazy",className:oe("w-full h-full object-cover transition-[filter] duration-150",u?"brightness-[0.6]":"brightness-[0.85] group-hover:brightness-100")}),c.jsx("div",{className:oe("absolute inset-x-0 bottom-0 px-2 py-1.5","bg-gradient-to-t from-black/70 to-transparent","opacity-0 group-hover:opacity-100 transition-opacity",u&&"opacity-100"),children:c.jsx("span",{className:"text-[10px] text-white font-medium leading-tight line-clamp-2",children:d.alt})}),u&&c.jsx("div",{className:"absolute top-2 right-2 w-6 h-6 rounded-full bg-blue-600 flex items-center justify-center",children:c.jsx(io,{size:14,className:"text-white"})})]},d.id)})}):c.jsx("div",{className:"text-center py-12 text-zinc-600 text-xs",children:"Nessuna immagine in libreria. Configura assets.assetsManifest nel tenant (es. da public/assets)."})]})}function kg({preview:e,onPreviewChange:t,onAssetUpload:r}){const[n,o]=b.useState(!1),i=b.useRef(null),s=b.useCallback(async u=>{if(fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"handleFile called",data:{fileName:u.name,hasOnAssetUpload:!!r},timestamp:Date.now(),hypothesisId:"H5"})}).catch(()=>{}),!u.type.startsWith("image/"))return;if(r){try{const h=await r(u);fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:handleFile",message:"onAssetUpload resolved",data:{url:h==null?void 0:h.slice(0,50)},timestamp:Date.now(),hypothesisId:"H2,H5"})}).catch(()=>{}),t({name:u.name,size:u.size,dataUrl:h})}catch{const h=new FileReader;h.onload=p=>{var w;t({name:u.name,size:u.size,dataUrl:(w=p.target)==null?void 0:w.result})},h.readAsDataURL(u)}return}const f=new FileReader;f.onload=h=>{var p;t({name:u.name,size:u.size,dataUrl:(p=h.target)==null?void 0:p.result})},f.readAsDataURL(u)},[t,r]),a=b.useCallback(u=>{var h,p;u.preventDefault(),u.stopPropagation(),o(!1);const f=(p=(h=u.dataTransfer)==null?void 0:h.files)==null?void 0:p[0];f&&s(f)},[s]),l=b.useCallback(u=>{u.preventDefault(),u.stopPropagation(),o(!0)},[]),d=b.useCallback(u=>{var h;const f=(h=u.target.files)==null?void 0:h[0];f&&s(f)},[s]);return c.jsxs("div",{onDragOver:l,onDragEnter:l,onDragLeave:u=>{u.preventDefault(),u.stopPropagation(),o(!1)},onDrop:a,onClick:()=>{var u;return!e&&((u=i.current)==null?void 0:u.click())},className:oe("rounded-xl border-2 border-dashed transition-all min-h-[240px]","flex flex-col items-center justify-center overflow-hidden cursor-pointer relative",n?"border-blue-500/50 bg-blue-500/[0.04]":e?"border-zinc-800 bg-transparent cursor-default":"border-zinc-800 bg-white/[0.01] hover:border-zinc-600 hover:bg-white/[0.02]"),children:[e?c.jsxs(c.Fragment,{children:[c.jsx("img",{src:e.dataUrl,alt:"Upload preview",className:"w-full max-h-[320px] object-contain"}),c.jsxs("div",{className:"absolute bottom-0 inset-x-0 bg-gradient-to-t from-black/80 to-transparent p-4 flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-xs font-medium text-white",children:e.name}),c.jsxs("p",{className:"text-[10px] text-zinc-400",children:[(e.size/1024).toFixed(1)," KB"]})]}),c.jsx(qe,{type:"button",variant:"ghost",className:"text-zinc-400 hover:text-red-400 hover:bg-red-500/10 h-8 w-8 p-0",onClick:u=>{u.stopPropagation(),t(null)},children:c.jsx(Qr,{size:14})})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/10 flex items-center justify-center text-blue-500 mb-3",children:c.jsx(is,{size:22})}),c.jsx("p",{className:"text-sm font-medium text-white mb-1",children:"Trascina un'immagine qui"}),c.jsx("p",{className:"text-[11px] text-zinc-500 mb-3",children:"oppure clicca per selezionare un file"}),c.jsx("span",{className:"text-[10px] text-zinc-600 bg-white/[0.03] px-3 py-1 rounded",children:"PNG, JPG, WebP — max 5MB"})]}),c.jsx("input",{ref:i,type:"file",accept:"image/*",className:"hidden",onChange:d})]})}function Sg({urlPreview:e,onUrlPreviewChange:t}){const[r,n]=b.useState(""),[o,i]=b.useState(!1),s=()=>{if(r.trim())try{new URL(r),t(r),i(!1)}catch{i(!0),t(null)}};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(Dt,{className:"block text-[10px] font-bold uppercase tracking-[0.08em] text-zinc-500 mb-1.5",children:"URL immagine"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(jo,{value:r,onChange:a=>{n(a.target.value),i(!1)},onKeyDown:a=>a.key==="Enter"&&s(),placeholder:"https://images.unsplash.com/photo-...",className:oe("h-8 text-xs bg-zinc-900/50 border-zinc-800",o&&"border-red-500/50")}),c.jsx(qe,{type:"button",variant:"outline",onClick:s,className:"shrink-0 h-8",children:"Anteprima"})]}),o&&c.jsx("p",{className:"text-[11px] text-red-400 mt-1.5",children:"URL non valido. Inserisci un URL completo (https://…)"})]}),e?c.jsxs("div",{className:"rounded-lg overflow-hidden ring-1 ring-zinc-800",children:[c.jsx("img",{src:e,alt:"URL preview",className:"w-full max-h-[320px] object-contain bg-black/30",onError:()=>{i(!0),t(null)}}),c.jsxs("div",{className:"px-3.5 py-2.5 bg-white/[0.02] border-t border-zinc-800 flex items-center gap-2",children:[c.jsx(io,{size:14,className:"text-emerald-400"}),c.jsx("span",{className:"text-[11px] text-zinc-500",children:"Immagine caricata correttamente"})]})]}):o?null:c.jsxs("div",{className:"flex flex-col items-center py-12 text-zinc-600",children:[c.jsx(ns,{size:32,className:"mb-3 opacity-40"}),c.jsx("p",{className:"text-xs",children:"Incolla un URL e premi Anteprima per verificare"})]})]})}const Cg=({open:e,onOpenChange:t,onSelect:r})=>{const{assets:n}=pr(),o=(n==null?void 0:n.assetsManifest)??[],[i,s]=b.useState("library"),[a,l]=b.useState(null),[d,u]=b.useState(null),[f,h]=b.useState(null);b.useEffect(()=>{e&&(s("library"),l(null),u(null),h(null))},[e]),b.useEffect(()=>{if(!e||i!=="upload")return;const y=()=>{fetch("http://127.0.0.1:7588/ingest/86d71502-47e1-433c-9b6d-5a1390d00813",{method:"POST",headers:{"Content-Type":"application/json","X-Debug-Session-Id":"34bba5"},body:JSON.stringify({sessionId:"34bba5",location:"ImagePickerDialog.tsx:beforeunload",message:"beforeunload fired",data:{},timestamp:Date.now(),hypothesisId:"H1"})}).catch(()=>{})};return window.addEventListener("beforeunload",y),()=>window.removeEventListener("beforeunload",y)},[e,i]),b.useEffect(()=>{if(!e||i!=="upload")return;const y=x=>{x.preventDefault()},k={capture:!0};return document.addEventListener("dragover",y,k),document.addEventListener("drop",y,k),window.addEventListener("dragover",y,k),window.addEventListener("drop",y,k),()=>{document.removeEventListener("dragover",y,k),document.removeEventListener("drop",y,k),window.removeEventListener("dragover",y,k),window.removeEventListener("drop",y,k)}},[e,i]);const p=i==="library"&&a!=null||i==="upload"&&d!=null||i==="url"&&f!=null,w=()=>{if(i==="library"&&a){const y=o.find(k=>k.id===a);y&&r({url:y.url,alt:y.alt})}else i==="upload"&&d?r({url:d.dataUrl,alt:d.name}):i==="url"&&f&&r({url:f,alt:""});setTimeout(()=>t(!1),0)},m=i==="library"&&a?"1 immagine selezionata":i==="upload"&&d?d.name:i==="url"&&f?"URL pronto":"Nessuna selezione",v=y=>{y.preventDefault(),y.stopPropagation()};return c.jsx(Rl,{open:e,onOpenChange:t,children:c.jsxs(Ll,{className:"max-w-2xl p-0 gap-0 max-h-[90vh] flex flex-col",preventCloseOnBackdropClick:i==="upload",onDragOver:v,onDrop:v,children:[c.jsxs($l,{className:"px-5 py-4 flex flex-row items-start justify-between gap-4 border-b border-zinc-800",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/15 text-blue-500",children:c.jsx(Zr,{size:18})}),c.jsxs("div",{children:[c.jsx(Fl,{children:"Image Picker"}),c.jsx(Wl,{children:"Scegli dalla libreria, carica dal disco o inserisci un link"})]})]}),c.jsx("button",{type:"button",onClick:()=>t(!1),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Chiudi",children:c.jsx(Ut,{size:18})})]}),c.jsx("div",{className:"flex border-b border-zinc-800",children:wg.map(y=>c.jsxs("button",{type:"button",onClick:()=>s(y),className:oe("flex items-center gap-2 px-4 py-3 text-xs font-medium border-b-2 transition-colors",i===y?"border-blue-500 text-blue-400":"border-transparent text-zinc-500 hover:text-zinc-300"),children:[y==="library"&&c.jsx(Zr,{size:14}),y==="upload"&&c.jsx(is,{size:14}),y==="url"&&c.jsx(ns,{size:14}),y==="library"?"Libreria":y==="upload"?"Upload":"URL"]},y))}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-5 min-h-0",children:[i==="library"&&c.jsx(yg,{library:o,selectedId:a,onSelect:l}),i==="upload"&&c.jsx(kg,{preview:d,onPreviewChange:u,onAssetUpload:n==null?void 0:n.onAssetUpload}),i==="url"&&c.jsx(Sg,{urlPreview:f,onUrlPreviewChange:h})]}),c.jsxs(xg,{className:"px-5 py-4 border-t border-zinc-800 flex-row justify-between",children:[c.jsx("span",{className:"text-[10px] uppercase tracking-[0.05em] text-zinc-600",children:m}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(qe,{type:"button",variant:"outline",size:"sm",onClick:()=>t(!1),children:"Annulla"}),c.jsx(qe,{type:"button",size:"sm",disabled:!p,onClick:w,className:oe(!p&&"opacity-40"),children:"Inserisci immagine"})]})]})]})})},Ul=(e,t="default")=>{if(e.startsWith("http")||e.startsWith("data:")||e.startsWith("#")||e.startsWith("/assets/"))return e;if(e.startsWith("assets/"))return`/${e}`;if(e.startsWith("/uploaded-assets/"))return e;if(!/\.(jpg|jpeg|png|gif|svg|pdf|webp|mp4|webm|ogg)$/i.test(e))return e.startsWith("/")?e:`/${e}`;const n=e.replace(/^\//,"");return`/assets/${t}/${n}`},Eg=({value:e,onChange:t,label:r="IMAGE",className:n})=>{const{tenantId:o="default"}=pr(),[i,s]=b.useState(!1),[a,l]=b.useState(!1),d=!!(e!=null&&e.url),u=e!=null&&e.url?Ul(e.url,o):"",f=p=>{t(p),s(!1)},h=p=>{p.stopPropagation(),t({url:"",alt:""})};return c.jsxs("div",{className:oe("space-y-1.5",n),children:[c.jsx(Dt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:r}),d?c.jsxs("div",{role:"button",tabIndex:0,onClick:()=>s(!0),onKeyDown:p=>p.key==="Enter"&&s(!0),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:oe("relative rounded-lg overflow-hidden cursor-pointer","ring-1 ring-zinc-800 transition-all",a&&"ring-blue-500/40"),children:[c.jsx("img",{src:u,alt:(e==null?void 0:e.alt)??"",className:"w-full h-40 object-cover block",onError:p=>{p.target.style.display="none"}}),c.jsx("div",{className:oe("absolute inset-0 flex items-center justify-center gap-2 transition-all duration-150",a?"bg-black/50":"bg-black/0"),children:a&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-1.5 bg-white/15 backdrop-blur-md rounded-lg px-3.5 py-2 text-white text-xs font-medium",children:[c.jsx(Rd,{size:13}),c.jsx("span",{children:"Cambia"})]}),c.jsx(qe,{type:"button",variant:"ghost",className:"h-8 w-8 p-0 bg-red-500/15 backdrop-blur-md text-red-300 hover:text-red-200 hover:bg-red-500/25",onClick:h,children:c.jsx(Qr,{size:13})})]})}),c.jsx("div",{className:"px-2.5 py-1.5 bg-black/50 text-[10px] text-zinc-500 truncate",children:((e==null?void 0:e.url)??"").length>50?"…"+((e==null?void 0:e.url)??"").slice(-47):(e==null?void 0:e.url)??""})]}):c.jsxs("button",{type:"button",onClick:()=>s(!0),className:oe("w-full rounded-lg border-2 border-dashed border-zinc-800 py-7","flex flex-col items-center gap-2","bg-white/[0.01] transition-all","hover:border-blue-500/30 hover:bg-blue-500/[0.03]","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500"),children:[c.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-500/10 flex items-center justify-center text-blue-500",children:c.jsx(Zr,{size:18})}),c.jsx("span",{className:"text-xs text-zinc-400 font-medium",children:"Clicca per aggiungere un'immagine"}),c.jsx("span",{className:"text-[10px] text-zinc-600",children:"Libreria · Upload · URL"})]}),c.jsx(Cg,{open:i,onOpenChange:s,onSelect:f})]})},Bl=[{name:"layers",Icon:ao},{name:"github",Icon:_d},{name:"arrow-right",Icon:Td},{name:"box",Icon:Pd},{name:"terminal",Icon:Wd},{name:"chevron-right",Icon:Od},{name:"menu",Icon:Md},{name:"x",Icon:Ut},{name:"sparkles",Icon:Fd},{name:"zap",Icon:Bd}],Kn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),ir={"ui:text":({label:e,value:t,onChange:r})=>c.jsxs("div",{className:"grid w-full items-center gap-2 mb-4",children:[c.jsx(Dt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Kn(e)}),c.jsx(jo,{type:"text",className:"h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:textarea":({label:e,value:t,onChange:r})=>c.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[c.jsx(Dt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Kn(e)}),c.jsx(qf,{className:"min-h-[96px] text-[13px] bg-zinc-900/50 border-zinc-700 focus-visible:ring-blue-600 resize-none",value:t||"",onChange:n=>r(n.target.value)})]}),"ui:select":({label:e,value:t,onChange:r,options:n=[]})=>c.jsxs("div",{className:"grid w-full gap-2 mb-4",children:[c.jsx(Dt,{className:"text-[11px] font-semibold tracking-[0.02em] text-zinc-300",children:Kn(e)}),c.jsxs(gg,{value:t||"",onValueChange:r,children:[c.jsx(Ol,{className:"w-full h-9 text-[13px] bg-zinc-900/50 border-zinc-700 focus:ring-blue-600",children:c.jsx(bg,{placeholder:"Select..."})}),c.jsx(Il,{className:"dark",children:n.map(o=>c.jsx(Dl,{value:o,className:"text-[13px]",children:o},o))})]})]}),"ui:checkbox":({label:e,value:t,onChange:r})=>c.jsxs("div",{className:"flex items-center space-x-2 mb-4 p-2.5 rounded border border-zinc-700/60 bg-zinc-900/20",children:[c.jsx(Xf,{id:e,checked:!!t,onCheckedChange:n=>r(n===!0)}),c.jsx(Dt,{htmlFor:e,className:"text-[13px] font-medium cursor-pointer select-none text-zinc-200",children:Kn(e)})]}),"ui:image-picker":({label:e,value:t,onChange:r})=>{const n=t!=null&&typeof t=="object"&&"url"in t?{url:String(t.url??""),alt:String(t.alt??"")}:{url:typeof t=="string"?t:"",alt:""},o=i=>{r(i)};return c.jsx("div",{className:"mb-4",children:c.jsx(Eg,{label:e,value:n,onChange:o})})},"ui:icon-picker":({label:e,value:t,onChange:r})=>{const[n,o]=b.useState(!1),i=Bl.find(s=>s.name===(t||""));return c.jsxs("div",{className:"grid w-full gap-1.5 mb-4",children:[c.jsx(Dt,{className:"text-[9px] uppercase font-black tracking-widest text-zinc-500",children:e}),c.jsxs(Rl,{open:n,onOpenChange:o,children:[c.jsx(vg,{asChild:!0,children:c.jsx(qe,{variant:"outline",className:"w-full h-9 rounded-md border border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 flex items-center gap-2 text-left",children:i?c.jsxs(c.Fragment,{children:[c.jsx(i.Icon,{size:16,className:"text-zinc-400 shrink-0"}),c.jsx("span",{className:"text-[11px] text-zinc-300 capitalize truncate",children:i.name})]}):c.jsxs(c.Fragment,{children:[c.jsx(Zr,{size:16,className:"text-zinc-500 shrink-0"}),c.jsx("span",{className:"text-[11px] text-zinc-500",children:"Choose icon..."})]})})}),c.jsxs(Ll,{className:"sm:max-w-[280px] p-4",children:[c.jsxs($l,{children:[c.jsx(Fl,{className:"text-sm",children:"Choose icon"}),c.jsx(Wl,{className:"text-xs",children:"Click an icon to select it."})]}),c.jsx("div",{className:"grid grid-cols-5 gap-2 py-2",children:Bl.map(({name:s,Icon:a})=>c.jsx("button",{type:"button",onClick:()=>{r(s),o(!1)},className:oe("flex items-center justify-center w-10 h-10 rounded-md border transition-colors",t===s?"border-blue-500 bg-blue-500/20 text-blue-400":"border-zinc-800 bg-zinc-900/50 hover:bg-zinc-800/50 text-zinc-400 hover:text-zinc-200"),title:s,children:c.jsx(a,{size:20})},s))})]})]})]})}},ai=e=>{if(e instanceof je.z.ZodOptional||e instanceof je.z.ZodDefault)return ai(e._def.innerType);if(e instanceof je.z.ZodObject){const t={id:crypto.randomUUID()};for(const r in e.shape)r!=="id"&&(t[r]=ai(e.shape[r]));return t}return e instanceof je.z.ZodArray?[]:e instanceof je.z.ZodString?"":e instanceof je.z.ZodNumber?0:e instanceof je.z.ZodBoolean?!1:e instanceof je.z.ZodEnum?e._def.values[0]:null},Gn=e=>e instanceof je.z.ZodOptional||e instanceof je.z.ZodDefault||e instanceof je.z.ZodNullable?Gn(e._def.innerType):e,Hl=e=>{var n;const t=e;if(typeof e.description=="string"&&e.description.length>0)return e.description;if(typeof((n=t._def)==null?void 0:n.description)=="string"&&t._def.description.length>0)return t._def.description;const r=Gn(e);return r!==e?Hl(r):null},Yn=(e,t)=>e&&!t?"opacity-10":"opacity-100",sr=(e,t)=>e!=null&&t.toLowerCase()===e.toLowerCase(),li=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),Ir=({schema:e,data:t,onChange:r,keys:n,expandedItemPath:o,onSidebarExpandedItemChange:i})=>{const s=e.shape,a=n!=null?Object.keys(s).filter(f=>n.includes(f)):Object.keys(s),l=o==null?void 0:o[0],d=(l==null?void 0:l.fieldKey)??null,u=d!=null;return c.jsx("div",{className:"space-y-4",children:a.map(f=>{const h=s[f];if(!h)return null;const p=Gn(h),w=Hl(h)||"ui:text",m=t[f];if(w==="ui:editorial-markdown")return null;if(w==="ui:image-picker"&&p instanceof je.z.ZodObject){const S=sr(d,f),C=ir["ui:image-picker"]||ir["ui:text"];return c.jsx("div",{className:`transition-opacity duration-200 ${Yn(u,S)}`,...S?{"data-jp-focused-field":f}:{},children:c.jsx(C,{label:f,value:m,onChange:E=>r({...t,[f]:E})})},f)}if(p instanceof je.z.ZodObject){const S=m||{},C=sr(d,f);return c.jsxs("div",{className:`group/obj mb-6 p-4 border border-zinc-800 rounded-lg bg-zinc-900/20 hover:border-zinc-700 transition-[border-color,opacity] duration-200 ${Yn(u,C)}`,...C?{"data-jp-focused-field":f}:{},children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx("div",{className:"w-1 h-3 bg-blue-500 rounded-full"}),c.jsx("h4",{className:"text-[11px] font-semibold text-zinc-300 tracking-[0.02em]",children:li(f)})]}),c.jsx(Ir,{schema:p,data:S,onChange:E=>r({...t,[f]:E}),expandedItemPath:o&&sr(l==null?void 0:l.fieldKey,f)?o.slice(1):void 0})]},f)}if(p instanceof je.z.ZodArray){const S=Array.isArray(m)?m:[],C=Gn(p.element),E=(R,I)=>{if(I<0||I>=S.length)return;const L=[...S],[M]=L.splice(R,1);L.splice(I,0,M),r({...t,[f]:L})},j=sr(d,f),_=sr(l==null?void 0:l.fieldKey,f)?l==null?void 0:l.itemId:void 0;return c.jsxs("div",{className:`mb-8 transition-opacity duration-200 ${Yn(u,j)}`,...j?{"data-jp-focused-field":f}:{},children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("label",{className:"text-[12px] font-semibold text-zinc-300 tracking-[0.01em]",children:[li(f)," (",S.length,")"]}),c.jsxs("button",{type:"button",onClick:()=>{const R=ai(C);r({...t,[f]:[...S,R]})},className:"flex items-center gap-1 px-2.5 py-1.5 bg-blue-600/10 hover:bg-blue-600/20 text-blue-400 rounded text-[11px] font-semibold transition-colors",children:[c.jsx(lo,{size:12})," Add Item"]})]}),c.jsx("div",{className:"space-y-2",children:S.map((R,I)=>{const L=R,M=L.id||`legacy-${I}`,Y=(typeof L.title=="string"?L.title:null)||(typeof L.label=="string"?L.label:null)||(typeof L.name=="string"?L.name:null)||(typeof L.content=="string"?L.content:null)||(typeof L.text=="string"?L.text:null)||`${li(f)} #${I+1}`,H=_,U=String(L.id??M),B=H!=null&&String(H)===U,T=B&&o&&o.length>1?o.slice(1):void 0,X=u&&j&&H!=null&&!B;return c.jsx(Ng,{itemId:U,openItemId:H!=null?String(H):void 0,isFaded:X,index:I,isFirst:I===0,isLast:I===S.length-1,label:Y,onExpandedChange:i?re=>i(re?{fieldKey:f,itemId:U}:null):void 0,onRemove:()=>{const re=S.filter((A,W)=>W!==I);r({...t,[f]:re})},onMoveUp:()=>E(I,I-1),onMoveDown:()=>E(I,I+1),children:C instanceof je.z.ZodObject?c.jsx(Ir,{schema:C,data:L||{},expandedItemPath:T,onChange:re=>{const A=[...S];A[I]=re,r({...t,[f]:A})}}):c.jsx("div",{className:"text-[10px] text-red-400",children:"Primitive arrays not supported."})},M)})})]},f)}const v=w in ir?w:"ui:text",y=ir[v]||ir["ui:text"],k=p instanceof je.z.ZodEnum?p._def.values:void 0,x=sr(d,f);return c.jsx("div",{className:`transition-opacity duration-200 ${Yn(u,x)}`,...x?{"data-jp-focused-field":f}:{},children:c.jsx(y,{label:f,value:m,options:k,onChange:S=>r({...t,[f]:S})})},f)})})},Ng=({itemId:e,openItemId:t,isFaded:r=!1,label:n,onExpandedChange:o,onRemove:i,onMoveUp:s,onMoveDown:a,isFirst:l,isLast:d,children:u})=>{const f=t!=null&&String(t)===String(e),[h,p]=b.useState(f);b.useEffect(()=>{t!=null&&(f&&!h&&p(!0),!f&&h&&p(!1))},[t,f,h]);const w=()=>{const v=!h;p(v),o==null||o(v)},m=f&&h;return c.jsxs("div",{className:`border border-zinc-800 rounded-md bg-zinc-900/40 overflow-hidden transition-opacity duration-200 ${r?"opacity-10":"opacity-100"}`,...m?{"data-jp-expanded-item":e}:{},children:[c.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-zinc-900/60",children:[c.jsx("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:c.jsxs("button",{type:"button",onClick:w,className:"flex items-center gap-2 text-[12px] font-semibold text-zinc-200 tracking-[0.01em] truncate",children:[h?c.jsx(so,{size:12,className:"shrink-0"}):c.jsx(Jr,{size:12,className:"shrink-0"}),c.jsx("span",{className:"truncate",children:n})]})}),c.jsxs("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[c.jsx("button",{type:"button",disabled:l,onClick:s,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:c.jsx(zd,{size:12})}),c.jsx("button",{type:"button",disabled:d,onClick:a,className:"text-zinc-500 hover:text-blue-400 disabled:opacity-20 p-1 transition-colors",children:c.jsx(Ad,{size:12})}),c.jsx("div",{className:"w-px h-3 bg-zinc-800 mx-1"}),c.jsx("button",{type:"button",onClick:i,className:"text-zinc-600 hover:text-red-500 transition-colors p-1",children:c.jsx(Qr,{size:12})})]})]}),h&&c.jsx("div",{className:"p-4 border-t border-zinc-800 bg-black/20",children:u})]})};function jg(e,t){return g.useReducer((r,n)=>t[r][n]??r,e)}var Dr=e=>{const{present:t,children:r}=e,n=Ag(t),o=typeof r=="function"?r({present:n.isPresent}):g.Children.only(r),i=ke(n.ref,Tg(o));return typeof r=="function"||n.isPresent?g.cloneElement(o,{ref:i}):null};Dr.displayName="Presence";function Ag(e){const[t,r]=g.useState(),n=g.useRef(null),o=g.useRef(e),i=g.useRef("none"),s=e?"mounted":"unmounted",[a,l]=jg(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const d=qn(n.current);i.current=a==="mounted"?d:"none"},[a]),Me(()=>{const d=n.current,u=o.current;if(u!==e){const h=i.current,p=qn(d);e?l("MOUNT"):p==="none"||(d==null?void 0:d.display)==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Me(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,f=p=>{const m=qn(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=p=>{p.target===t&&(i.current=qn(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:g.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function qn(e){return(e==null?void 0:e.animationName)||"none"}function Tg(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var[Xn]=Ar("Tooltip",[Qt]),Jn=Qt(),Vl="TooltipProvider",zg=700,ci="tooltip.open",[Pg,di]=Xn(Vl),Kl=e=>{const{__scopeTooltip:t,delayDuration:r=zg,skipDelayDuration:n=300,disableHoverableContent:o=!1,children:i}=e,s=g.useRef(!0),a=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const d=l.current;return()=>window.clearTimeout(d)},[]),c.jsx(Pg,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),s.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:g.useCallback(d=>{a.current=d},[]),disableHoverableContent:o,children:i})};Kl.displayName=Vl;var _r="Tooltip",[Og,Mr]=Xn(_r),Gl=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=di(_r,e.__scopeTooltip),d=Jn(t),[u,f]=g.useState(null),h=Tr(),p=g.useRef(0),w=s??l.disableHoverableContent,m=a??l.delayDuration,v=g.useRef(!1),[y,k]=Dn({prop:n,defaultProp:o??!1,onChange:j=>{j?(l.onOpen(),document.dispatchEvent(new CustomEvent(ci))):l.onClose(),i==null||i(j)},caller:_r}),x=g.useMemo(()=>y?v.current?"delayed-open":"instant-open":"closed",[y]),S=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,k(!0)},[k]),C=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,k(!1)},[k]),E=g.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,k(!0),p.current=0},m)},[m,k]);return g.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),c.jsx(Ko,{...d,children:c.jsx(Og,{scope:t,contentId:h,open:y,stateAttribute:x,trigger:u,onTriggerChange:f,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayedRef.current?E():S()},[l.isOpenDelayedRef,E,S]),onTriggerLeave:g.useCallback(()=>{w?C():(window.clearTimeout(p.current),p.current=0)},[C,w]),onOpen:S,onClose:C,disableHoverableContent:w,children:r})})};Gl.displayName=_r;var ui="TooltipTrigger",Yl=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Mr(ui,r),i=di(ui,r),s=Jn(r),a=g.useRef(null),l=ke(t,a,o.onTriggerChange),d=g.useRef(!1),u=g.useRef(!1),f=g.useCallback(()=>d.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),c.jsx(On,{asChild:!0,...s,children:c.jsx(we.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...n,ref:l,onPointerMove:pe(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:pe(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:pe(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:pe(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:pe(e.onBlur,o.onClose),onClick:pe(e.onClick,o.onClose)})})});Yl.displayName=ui;var fi="TooltipPortal",[Ig,Dg]=Xn(fi,{forceMount:void 0}),ql=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:o}=e,i=Mr(fi,t);return c.jsx(Ig,{scope:t,forceMount:r,children:c.jsx(Dr,{present:r||i.open,children:c.jsx(In,{asChild:!0,container:o,children:n})})})};ql.displayName=fi;var ar="TooltipContent",Xl=g.forwardRef((e,t)=>{const r=Dg(ar,e.__scopeTooltip),{forceMount:n=r.forceMount,side:o="top",...i}=e,s=Mr(ar,e.__scopeTooltip);return c.jsx(Dr,{present:n||s.open,children:s.disableHoverableContent?c.jsx(Jl,{side:o,...i,ref:t}):c.jsx(_g,{side:o,...i,ref:t})})}),_g=g.forwardRef((e,t)=>{const r=Mr(ar,e.__scopeTooltip),n=di(ar,e.__scopeTooltip),o=g.useRef(null),i=ke(t,o),[s,a]=g.useState(null),{trigger:l,onClose:d}=r,u=o.current,{onPointerInTransitChange:f}=n,h=g.useCallback(()=>{a(null),f(!1)},[f]),p=g.useCallback((w,m)=>{const v=w.currentTarget,y={x:w.clientX,y:w.clientY},k=Fg(y,v.getBoundingClientRect()),x=Wg(y,k),S=Ug(m.getBoundingClientRect()),C=Hg([...x,...S]);a(C),f(!0)},[f]);return g.useEffect(()=>()=>h(),[h]),g.useEffect(()=>{if(l&&u){const w=v=>p(v,u),m=v=>p(v,l);return l.addEventListener("pointerleave",w),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",w),u.removeEventListener("pointerleave",m)}}},[l,u,p,h]),g.useEffect(()=>{if(s){const w=m=>{const v=m.target,y={x:m.clientX,y:m.clientY},k=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),x=!Bg(y,s);k?h():x&&(h(),d())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[l,u,s,d,h]),c.jsx(Jl,{...e,ref:i})}),[Mg,Rg]=Xn(_r,{isInside:!1}),Lg=ep("TooltipContent"),Jl=g.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Mr(ar,r),d=Jn(r),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(ci,u),()=>document.removeEventListener(ci,u)),[u]),g.useEffect(()=>{if(l.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),c.jsx(yn,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:c.jsxs(Go,{"data-state":l.stateAttribute,...d,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(Lg,{children:n}),c.jsx(Mg,{scope:r,isInside:!0,children:c.jsx(Zh,{id:l.contentId,role:"tooltip",children:o||n})})]})})});Xl.displayName=ar;var Zl="TooltipArrow",$g=g.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,o=Jn(r);return Rg(Zl,r).isInside?null:c.jsx(Yo,{...o,...n,ref:t})});$g.displayName=Zl;function Fg(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,o,i)){case i:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Wg(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Ug(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}function Bg(e,t){const{x:r,y:n}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],d=a.x,u=a.y,f=l.x,h=l.y;u>n!=h>n&&r<(f-d)*(n-u)/(h-u)+d&&(o=!o)}return o}function Hg(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Vg(t)}function Vg(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const o=e[n];for(;r.length>=2;){const i=r[r.length-1],s=r[r.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))r.pop();else break}r.push(o)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Kg=Kl,Gg=Gl,Yg=Yl,qg=ql,Ql=Xl;const Xg=Kg,Rr=Gg,Lr=Yg,lr=g.forwardRef(({className:e,sideOffset:t=4,...r},n)=>c.jsx(qg,{children:c.jsx(Ql,{ref:n,sideOffset:t,className:oe("z-50 rounded-md bg-zinc-800 px-2.5 py-1.5 text-[11px] text-zinc-200 shadow-md","animate-in fade-in-0 zoom-in-95",e),...r})}));lr.displayName=Ql.displayName;var Zn="Popover",[ec]=Ar(Zn,[Qt]),$r=Qt(),[Jg,Nt]=ec(Zn),tc=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=$r(t),l=g.useRef(null),[d,u]=g.useState(!1),[f,h]=Dn({prop:n,defaultProp:o??!1,onChange:i,caller:Zn});return c.jsx(Ko,{...a,children:c.jsx(Jg,{scope:t,contentId:Tr(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:g.useCallback(()=>h(p=>!p),[h]),hasCustomAnchor:d,onCustomAnchorAdd:g.useCallback(()=>u(!0),[]),onCustomAnchorRemove:g.useCallback(()=>u(!1),[]),modal:s,children:r})})};tc.displayName=Zn;var rc="PopoverAnchor",Zg=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Nt(rc,r),i=$r(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return g.useEffect(()=>(s(),()=>a()),[s,a]),c.jsx(On,{...i,...n,ref:t})});Zg.displayName=rc;var nc="PopoverTrigger",oc=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Nt(nc,r),i=$r(r),s=ke(t,o.triggerRef),a=c.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":cc(o.open),...n,ref:s,onClick:pe(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:c.jsx(On,{asChild:!0,...i,children:a})});oc.displayName=nc;var pi="PopoverPortal",[Qg,e0]=ec(pi,{forceMount:void 0}),ic=e=>{const{__scopePopover:t,forceMount:r,children:n,container:o}=e,i=Nt(pi,t);return c.jsx(Qg,{scope:t,forceMount:r,children:c.jsx(Dr,{present:r||i.open,children:c.jsx(In,{asChild:!0,container:o,children:n})})})};ic.displayName=pi;var cr="PopoverContent",sc=g.forwardRef((e,t)=>{const r=e0(cr,e.__scopePopover),{forceMount:n=r.forceMount,...o}=e,i=Nt(cr,e.__scopePopover);return c.jsx(Dr,{present:n||i.open,children:i.modal?c.jsx(r0,{...o,ref:t}):c.jsx(n0,{...o,ref:t})})});sc.displayName=cr;var t0=Yt("PopoverContent.RemoveScroll"),r0=g.forwardRef((e,t)=>{const r=Nt(cr,e.__scopePopover),n=g.useRef(null),o=ke(t,n),i=g.useRef(!1);return g.useEffect(()=>{const s=n.current;if(s)return Ka(s)},[]),c.jsx(ei,{as:t0,allowPinchZoom:!0,children:c.jsx(ac,{...e,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:pe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:pe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,d=a.button===2||l;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:pe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),n0=g.forwardRef((e,t)=>{const r=Nt(cr,e.__scopePopover),n=g.useRef(!1),o=g.useRef(!1);return c.jsx(ac,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),i.preventDefault()),n.current=!1,o.current=!1},onInteractOutside:i=>{var l,d;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),ac=g.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...f}=e,h=Nt(cr,r),p=$r(r);return oa(),c.jsx(Oo,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:o,onUnmountAutoFocus:i,children:c.jsx(yn,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>h.onOpenChange(!1),children:c.jsx(Go,{"data-state":cc(h.open),role:"dialog",id:h.contentId,...p,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),lc="PopoverClose",o0=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=Nt(lc,r);return c.jsx(we.button,{type:"button",...n,ref:t,onClick:pe(e.onClick,()=>o.onOpenChange(!1))})});o0.displayName=lc;var i0="PopoverArrow",s0=g.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,o=$r(r);return c.jsx(Yo,{...o,...n,ref:t})});s0.displayName=i0;function cc(e){return e?"open":"closed"}var a0=tc,l0=oc,c0=ic,dc=sc;const d0=a0,u0=l0,uc=g.forwardRef(({className:e,align:t="start",sideOffset:r=6,...n},o)=>c.jsx(c0,{children:c.jsx(dc,{ref:o,align:t,sideOffset:r,className:oe("z-50 w-[var(--radix-popover-trigger-width)] rounded-lg border border-zinc-700/80 bg-zinc-950 p-1 text-white shadow-xl shadow-black/30","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2",e),...n})}));uc.displayName=dc.displayName;const fc=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"Select page",f0=({pageSlugs:e,currentSlug:t,onPageChange:r,sectionCount:n,onNewPage:o,className:i,currentPageLabel:s})=>{const[a,l]=b.useState(!1),d=s??fc(t),u=f=>{r(f),l(!1)};return c.jsx("div",{className:oe("mx-3 mt-2 mb-2",i),children:c.jsxs(d0,{open:a,onOpenChange:l,children:[c.jsx(u0,{asChild:!0,children:c.jsxs("button",{type:"button","aria-haspopup":"listbox","aria-label":`Select page, current: ${d}`,className:oe("flex items-center gap-2 w-full pl-3 pr-4 py-2 rounded-lg border text-left transition-all duration-150 cursor-pointer","bg-transparent border-zinc-800 text-zinc-400 hover:text-zinc-200 hover:bg-zinc-800/50 hover:border-zinc-700","data-[state=open]:bg-zinc-950 data-[state=open]:border-zinc-800 data-[state=open]:text-zinc-100","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-zinc-950"),children:[c.jsx(Dd,{size:14,className:"shrink-0 text-zinc-500","aria-hidden":!0}),c.jsx("span",{className:"text-xs font-medium flex-1 truncate",children:d}),c.jsx(Jr,{size:13,className:"shrink-0 text-zinc-500","aria-hidden":!0})]})}),c.jsxs(uc,{align:"start",sideOffset:4,className:"min-w-[var(--radix-popover-trigger-width)] bg-zinc-950 border-zinc-800 p-1",role:"listbox","aria-label":"Page list",children:[e.map(f=>{const h=f===t,p=fc(f);return c.jsxs("button",{type:"button",role:"option","aria-selected":h,onClick:()=>u(f),className:oe("flex items-center justify-between w-full px-2.5 py-2 rounded-md text-xs transition-colors cursor-pointer",h?"bg-primary/10 text-primary font-semibold":"text-zinc-400 hover:bg-zinc-800 hover:text-zinc-200"),children:[c.jsx("span",{children:p}),n!=null&&c.jsxs("span",{className:"text-[10px] text-zinc-600 tabular-nums","aria-hidden":!0,children:[n,"s"]})]},f)}),o!=null&&c.jsx("div",{className:"border-t border-zinc-800 mt-1 pt-1",children:c.jsxs("button",{type:"button",onClick:()=>{o(),l(!1)},className:"flex items-center gap-1.5 w-full px-2.5 py-2 rounded-md text-[11px] text-zinc-600 hover:text-zinc-300 hover:bg-zinc-800 transition-colors cursor-pointer","aria-label":"New page",children:[c.jsx(lo,{size:12,"aria-hidden":!0}),c.jsx("span",{children:"New page"})]})})]})]})})},hi=new Set(["anchorId","paddingTop","paddingBottom","theme","container"]),pc=new Set(["ui:editorial-markdown"]),hc=e=>e instanceof je.z.ZodOptional||e instanceof je.z.ZodDefault||e instanceof je.z.ZodNullable?hc(e._def.innerType):e,mi=e=>{var i;if(!e)return"";const t=e,r=typeof e.description=="string"?e.description:null;if(r)return r;const n=typeof((i=t._def)==null?void 0:i.description)=="string"?t._def.description:null;if(n)return n;const o=hc(e);return o!==e?mi(o):""},gi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()),p0={activationConstraint:{distance:8}},h0={activationConstraint:{delay:200,tolerance:5}};function bi({layer:e,opts:t,dragHandleProps:r}){const{isSelected:n,isActive:o,isDragging:i,canDelete:s,onSelect:a,onOpenSettings:l,onDelete:d}=t,u=!!r;return c.jsxs("div",{className:oe("group flex items-center gap-2 pl-1 pr-2 py-2.5 rounded-lg text-left transition-all duration-200 cursor-pointer border-l-2",n?"bg-primary/[0.08] border-primary":o?"bg-zinc-800/30 border-emerald-500/60":"border-transparent hover:bg-zinc-800/40",i&&"opacity-50 shadow-lg",u?"cursor-grab active:cursor-grabbing":"cursor-default"),children:[u?c.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-150 cursor-grab touch-none","aria-label":"Trascina per riordinare",...r,children:c.jsx(rs,{size:12,className:"text-zinc-600"})}):c.jsx("span",{className:"shrink-0 w-5 flex items-center justify-center opacity-0 group-hover:opacity-100 pointer-events-none",children:c.jsx(rs,{size:12,className:"text-zinc-600/50"})}),c.jsxs("button",{type:"button",onClick:a,className:"flex-1 min-w-0 text-left",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:oe("text-xs font-bold uppercase tracking-[0.06em] truncate",n?"text-primary":"text-zinc-500"),children:e.type}),o&&c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0","aria-hidden":!0})]}),c.jsx("span",{className:"text-[11px] text-zinc-600 block truncate leading-snug mt-0.5",children:e.title??`${e.type} section`})]}),c.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity duration-150",children:[c.jsxs(Rr,{children:[c.jsx(Lr,{asChild:!0,children:c.jsx(qe,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-zinc-300",onClick:f=>{f.stopPropagation(),l(f)},children:c.jsx($d,{size:12})})}),c.jsx(lr,{children:"Settings"})]}),s&&c.jsxs(Rr,{children:[c.jsx(Lr,{asChild:!0,children:c.jsx(qe,{variant:"ghost",size:"icon-xs",className:"text-zinc-600 hover:text-destructive",onClick:f=>{f.stopPropagation(),d()},children:c.jsx(Qr,{size:12})})}),c.jsx(lr,{children:"Delete section"})]})]})]})}function m0({layer:e,opts:t}){const{attributes:r,listeners:n,setNodeRef:o,transform:i,transition:s,isDragging:a}=Hf({id:e.id,disabled:!t.canReorder}),l={transform:xt.Transform.toString(i),transition:s};return c.jsx("div",{ref:o,style:l,className:oe(a&&"z-10"),children:c.jsx(bi,{layer:e,opts:{...t,isDragging:a},dragHandleProps:t.canReorder?{...r,...n,"aria-roledescription":"elemento trascinabile"}:void 0})})}const mc=({selectedSection:e,pageData:t,allSectionsData:r=[],onUpdate:n,onUpdateSection:o,onClose:i,expandedItemPath:s=null,onReorderSection:a,allLayers:l=[],activeSectionId:d,onRequestScrollToSection:u,onDeleteSection:f,onAddSection:h,hasChanges:p=!1,onSaveToFile:w,onHotSave:m,saveSuccessFeedback:v=!1,hotSaveSuccessFeedback:y=!1,hotSaveInProgress:k=!1,showLegacySave:x=!0,showHotSave:S=!1,onResetToFile:C,showResetToFile:E=!1,pageSlugs:j=[],currentSlug:N="home",onPageChange:_})=>{const{schemas:R}=pr(),[I,L]=b.useState(!0),[M,Y]=b.useState(null),[H,U]=b.useState(null),[B,T]=b.useState(null),[X,re]=b.useState(null),A=b.useRef(null),W=b.useRef(null),q=mu(mo(ko,p0),mo(zs,h0),mo(wo,{coordinateGetter:Gf})),G=b.useDeferredValue(e),me=e!=null&&(G==null?void 0:G.id)!==e.id,se=s&&s.length>0?s:B?[B]:null,P=se!=null&&se.length?{fieldKey:se[se.length-1].fieldKey,itemId:se[se.length-1].itemId}:null,J=b.useRef(s);b.useEffect(()=>{J.current!=null&&s==null&&T(null),J.current=s},[s]),b.useEffect(()=>{(e==null?void 0:e.id)!=null&&L(!1)},[e==null?void 0:e.id]);const te=()=>{const D=requestAnimationFrame(()=>{requestAnimationFrame(()=>{const ee=A.current;ee&&ee.scrollTo({top:0,behavior:"smooth"})})});return()=>cancelAnimationFrame(D)},F=b.useRef(I);b.useEffect(()=>{if(I&&!F.current){const D=te();return F.current=I,D}F.current=I},[I]),b.useEffect(()=>{if(!P)return;const D=A.current;if(!D)return;const ee=requestAnimationFrame(()=>{const ie=D.querySelector("[data-jp-expanded-item]")??D.querySelector("[data-jp-focused-field]");ie&&ie.scrollIntoView({behavior:"smooth",block:"start"})});return()=>cancelAnimationFrame(ee)},[P]);const ne=D=>{L(!1),u==null||u(D)},Q=()=>{L(D=>{const ee=!D;return ee&&te(),ee})},xe=(D,ee)=>{ee.stopPropagation(),r.length>0&&o?re(D):(L(!1),u==null||u(D))};b.useEffect(()=>{if(X==null)return;const D=ee=>{ee.key==="Escape"&&re(null)};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[X]);const ge=D=>{M===D?(f==null||f(D),Y(null)):(Y(D),setTimeout(()=>Y(null),3e3))},ze=b.useMemo(()=>l.filter(D=>D.scope==="local").map(D=>D.id),[l]),Oe=!!a&&ze.length>0,Be=D=>{U(D.active.id)},jt=D=>{U(null);const{active:ee,over:ie}=D;if(!ie||ee.id===ie.id||!a)return;const fe=l.findIndex(Ee=>Ee.id===ee.id),Ie=l.findIndex(Ee=>Ee.id===ie.id);if(fe===-1||Ie===-1)return;const ye=fe<Ie?Ie:Ie-1;a(ee.id,ye)},Xe=e?t.sections.find(D=>D.id===e.id):void 0,He=G?t.sections.find(D=>D.id===G.id):void 0,Ve=G?R[G.type]:void 0,mt=b.useMemo(()=>{if(!Ve)return!1;const D=Ve.shape,ee=Object.keys(D).filter(ie=>!hi.has(ie));return ee.length===0?!1:ee.every(ie=>pc.has(mi(D[ie])))},[Ve]);b.useEffect(()=>{(e==null?void 0:e.id)!=null&&mt&&L(!0)},[e==null?void 0:e.id,mt]);const ot=l.length>0&&(I||!e),At=N?N.charAt(0).toUpperCase()+N.slice(1):"Select page",Wr=b.useMemo(()=>{const D=[];let ee=null;for(const ie of l){const fe=ie.type.toUpperCase(),Ie=ee!==null&&(ee==="HEADER"&&fe!=="HEADER"||ee!=="HEADER"&&ee!=="FOOTER"&&fe==="FOOTER");D.push({layer:ie,showSeparatorAbove:Ie}),ee=fe}return D},[l]);return c.jsx(Xg,{children:c.jsxs("aside",{className:"relative w-full h-full bg-zinc-950 border-l border-zinc-800 flex flex-col shadow-2xl shrink-0 min-w-0 animate-in slide-in-from-right duration-300",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h2",{className:"text-sm font-bold text-white",children:"Inspector"}),c.jsx("p",{className:"text-[10px] tracking-[0.06em] text-zinc-600 mt-0.5",children:e?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-primary font-bold",children:e.type}),c.jsx("span",{className:"text-zinc-700 mx-1.5",children:"|"}),c.jsx("span",{className:"uppercase",children:e.scope})]}):c.jsxs("span",{className:"text-zinc-600",children:[At," · ",l.length," sections"]})})]}),c.jsx(qe,{variant:"ghost",size:"icon-sm",onClick:i,"aria-label":"Close Inspector",children:c.jsx(Ut,{size:14})})]}),j.length>0&&_&&c.jsx(f0,{pageSlugs:j,currentSlug:N,onPageChange:_,sectionCount:l.length,currentPageLabel:At}),l.length>0&&c.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-t border-zinc-800/50",children:[c.jsxs("button",{type:"button",onClick:Q,className:"flex items-center gap-2 flex-1 cursor-pointer min-w-0 text-left","aria-expanded":ot,"aria-label":ot?"Collapse Page Layers":"Expand Page Layers",children:[c.jsx(ao,{size:14,className:"text-zinc-500 shrink-0"}),c.jsx("span",{className:"text-[11px] font-semibold tracking-[0.04em] text-zinc-400",children:"Page Layers"}),c.jsxs("span",{className:"text-[10px] text-zinc-600",children:["(",l.length,")"]}),c.jsx(so,{size:13,className:oe("ml-auto text-zinc-600 transition-transform duration-200 shrink-0",!I&&"rotate-180")})]}),h!=null&&c.jsxs(Rr,{children:[c.jsx(Lr,{asChild:!0,children:c.jsx(qe,{variant:"ghost",size:"icon-sm",className:"text-zinc-500 hover:text-primary",onClick:h,children:c.jsx(lo,{size:14})})}),c.jsx(lr,{children:"Add section"})]})]}),c.jsx("div",{className:"relative flex-1 min-h-0 min-w-0 flex flex-col overflow-hidden",children:c.jsxs("div",{ref:A,className:"min-h-0 min-w-0 flex-1 overflow-y-auto overflow-x-hidden flex flex-col",role:"region","aria-label":"Inspector content",children:[c.jsx("div",{className:"flex flex-col min-h-0",children:ot&&c.jsxs("div",{className:"py-1",children:[c.jsxs(pf,{sensors:q,collisionDetection:vu,modifiers:[Pf],onDragStart:Be,onDragEnd:jt,accessibility:{announcements:{onDragStart:()=>"Sezione presa in carico. Usa i tasti freccia per spostare, Spazio per rilasciare.",onDragOver:({over:D})=>D?`Posizione ${ze.indexOf(String(D.id))+1} di ${ze.length}.`:void 0,onDragEnd:({over:D})=>D?"Sezione rilasciata in nuova posizione.":"Riposizionamento annullato.",onDragCancel:()=>"Riposizionamento annullato."}},children:[c.jsx(Rf,{items:ze,strategy:_f,children:c.jsx("div",{className:"px-2 space-y-0.5",children:Wr.map(({layer:D,showSeparatorAbove:ee})=>c.jsxs(b.Fragment,{children:[ee&&c.jsx("div",{className:"mx-3 border-t border-zinc-800/60 my-1"}),D.scope==="local"&&Oe?c.jsx(m0,{layer:D,opts:{isSelected:(e==null?void 0:e.id)===D.id,isActive:d===D.id,isDragging:!1,canReorder:!0,canDelete:!!f,deleteConfirm:M===D.id,onSelect:()=>ne(D.id),onDelete:()=>ge(D.id),onOpenSettings:ie=>xe(D.id,ie)}}):c.jsx("div",{children:c.jsx(bi,{layer:D,opts:{isSelected:(e==null?void 0:e.id)===D.id,isActive:d===D.id,isDragging:!1,canDelete:D.scope==="local"&&!!f,deleteConfirm:M===D.id,onSelect:()=>ne(D.id),onDelete:()=>ge(D.id),onOpenSettings:ie=>xe(D.id,ie)}})})]},D.id))})}),c.jsx(zf,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:H?(()=>{const D=l.find(ee=>ee.id===H);return D?c.jsx("div",{className:"px-2 w-full max-w-[var(--inspector-width,280px)]",children:c.jsx(bi,{layer:D,opts:{isSelected:!1,isActive:!1,isDragging:!0,canDelete:!1,deleteConfirm:!1,onSelect:()=>{},onDelete:()=>{},onOpenSettings:()=>{}},dragHandleProps:{"aria-hidden":!0}})}):null})():null})]}),M&&c.jsxs("div",{className:"flex items-center gap-2 py-2 px-3 mt-1 mx-2 rounded-md bg-amber-500/10 border border-amber-500/30",children:[c.jsx(Id,{size:12,className:"text-amber-500 shrink-0"}),c.jsx("p",{className:"text-[10px] text-amber-500 font-medium",children:"Click delete again to confirm"})]})]})}),P&&Xe&&(()=>{const D=Xe.data||{};let ee;if(se&&se.length>0){let ie=D;for(const ye of se){const Ee=ie==null?void 0:ie[ye.fieldKey];ye.itemId!=null&&Array.isArray(Ee)?ie=Ee.find(O=>String(O==null?void 0:O.id)===String(ye.itemId))??null:ie=Ee}const fe=ie||{},Ie=P.fieldKey;ee=(typeof fe.name=="string"?fe.name:null)??(typeof fe.title=="string"?fe.title:null)??(typeof fe.label=="string"?fe.label:null)??gi(Ie)}else{const ie=P.fieldKey;if(P.itemId!=null){const ye=(Array.isArray(D[ie])?D[ie]:[]).find(Ee=>String(Ee==null?void 0:Ee.id)===String(P.itemId))||{};ee=(typeof ye.name=="string"?ye.name:null)??(typeof ye.title=="string"?ye.title:null)??(typeof ye.label=="string"?ye.label:null)??gi(ie)}else ee=gi(ie)}return c.jsxs("div",{className:"px-4 py-2 border-b border-zinc-800 bg-zinc-900/50",children:[c.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-zinc-500",children:"Editing"}),c.jsx("p",{className:"text-xs font-medium text-white truncate mt-0.5",children:ee})]})})(),c.jsx("div",{className:"flex-1 p-4",onFocusCapture:()=>e!=null&&L(!1),children:e?me?c.jsxs("div",{className:"space-y-4 animate-pulse",role:"status","aria-label":"Loading form",children:[c.jsx("div",{className:"h-4 w-3/4 rounded bg-zinc-800"}),c.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),c.jsx("div",{className:"h-10 rounded bg-zinc-800/80"}),c.jsx("div",{className:"h-20 rounded bg-zinc-800/80"}),c.jsx("div",{className:"h-10 rounded bg-zinc-800/60"})]}):Ve?(()=>{const ee=Object.keys(Ve.shape).filter(fe=>!hi.has(fe)&&!pc.has(mi(Ve.shape[fe]))),ie=(He==null?void 0:He.data)||{};return ee.length===0?c.jsx("p",{className:"text-xs text-zinc-500",children:"Inline editorial section: edit content directly on the canvas."}):c.jsx(Ir,{schema:Ve,data:ie,onChange:fe=>n(fe),keys:ee,expandedItemPath:se,onSidebarExpandedItemChange:T})})():c.jsxs("div",{className:"text-xs text-red-400 p-4 border border-dashed border-red-900/30 rounded bg-red-900/10",children:["No schema found for ",(G==null?void 0:G.type)??e.type]}):c.jsx("p",{className:"text-xs text-zinc-600 text-center py-10",children:"Select a layer above or on the stage to edit."})})]})}),c.jsx("div",{className:"px-4 py-2.5 border-t border-zinc-800 bg-zinc-900/50 flex items-center justify-between gap-3 opacity-100 shrink-0",children:(x&&w!=null||S&&m!=null||C!=null)&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("div",{className:oe("w-2 h-2 rounded-full transition-colors duration-300 shrink-0",p?"bg-amber-500 shadow-[0_0_8px_rgba(245,158,11,0.5)]":"bg-emerald-500")}),c.jsx("span",{className:oe("text-sm font-medium transition-colors duration-300 truncate",v||y?"text-emerald-400":p?"text-amber-500":"text-zinc-500"),children:v||y?"Saved":p?"Unsaved Changes":"All Changes Saved"})]}),x&&w!=null&&c.jsxs(Rr,{children:[c.jsx(Lr,{asChild:!0,children:c.jsxs(qe,{size:"default",disabled:!p,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:D=>{D.preventDefault(),D.stopPropagation(),w()},children:[c.jsx(os,{size:14}),c.jsx("span",{children:"Save"})]})}),c.jsx(lr,{children:"Save to file"})]}),S&&m!=null&&c.jsxs(Rr,{children:[c.jsx(Lr,{asChild:!0,children:c.jsxs(qe,{size:"default",disabled:!p||k,className:"h-9 min-w-[156px] px-5 text-sm gap-2 ml-auto",onClick:D=>{D.preventDefault(),D.stopPropagation(),m()},children:[c.jsx(os,{size:14}),c.jsx("span",{children:k?"Saving...":"Hot Save"})]})}),c.jsx(lr,{children:"Hot save to edge"})]}),C!=null&&E&&c.jsx("button",{type:"button",onClick:C,className:"shrink-0 flex items-center gap-1.5 px-2 py-1 rounded text-[11px] font-medium transition-all border border-zinc-700 bg-zinc-900 text-zinc-400 hover:bg-zinc-800 hover:border-zinc-600 hover:text-zinc-300",title:"Ripristina la pagina dal file (elimina le modifiche in memoria)",children:c.jsx("span",{children:"Ripristina da file"})})]})}),X!=null&&r.length>0&&o!=null&&(()=>{const D=r.find(O=>O.id===X),ee=l.find(O=>O.id===X);if(!D)return null;const ie=(ee==null?void 0:ee.scope)==="global"?"global":"local",fe=D.type,Ie=R[fe],Ee=(Ie?Object.keys(Ie.shape):[]).filter(O=>hi.has(O)),z=D.data??{};return Ee.length===0?c.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:()=>re(null),children:c.jsxs("div",{ref:W,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full overflow-hidden",onClick:O=>O.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800",children:[c.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",fe]}),c.jsx("button",{type:"button",onClick:()=>re(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings",children:c.jsx(Ut,{size:18})})]}),c.jsx("div",{className:"p-4",children:c.jsx("p",{className:"text-xs text-zinc-500",children:"No settings fields for this section."})})]})}):c.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"section-settings-modal-title",onClick:O=>O.target===O.currentTarget&&re(null),children:c.jsxs("div",{ref:W,className:"relative rounded-lg border border-zinc-700 bg-zinc-900 shadow-xl max-w-md w-full max-h-[85vh] flex flex-col overflow-hidden",onClick:O=>O.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-zinc-800 shrink-0",children:[c.jsxs("h2",{id:"section-settings-modal-title",className:"text-sm font-bold text-white",children:["Settings — ",fe]}),c.jsx("button",{type:"button",onClick:()=>re(null),className:"p-1.5 rounded text-zinc-500 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close settings (Escape)",children:c.jsx(Ut,{size:18})})]}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4 custom-scrollbar",children:c.jsx(Ir,{schema:Ie,data:z,onChange:O=>{const $={...D.data,...O};o(X,ie,fe,$)},keys:Ee})})]})})})()]})})},gc=({draft:e,globalDraft:t,menuConfig:r,themeConfig:n,slug:o,selectedId:i,scrollToSectionId:s,onScrollRequested:a})=>{const l=b.useRef(null),d=b.useCallback(()=>{var u;(u=l.current)!=null&&u.contentWindow&&l.current.contentWindow.postMessage({type:ve.UPDATE_DRAFTS,draft:e,globalDraft:t,menuConfig:r,themeConfig:n},"*")},[e,t,r,n]);return b.useEffect(()=>{d()},[d]),b.useEffect(()=>{const u=f=>{f.data.type===ve.STAGE_READY&&d()};return window.addEventListener("message",u),()=>window.removeEventListener("message",u)},[d]),b.useEffect(()=>{var u;(u=l.current)!=null&&u.contentWindow&&l.current.contentWindow.postMessage({type:ve.SYNC_SELECTION,selectedId:i},"*")},[i]),b.useEffect(()=>{var u;!s||!((u=l.current)!=null&&u.contentWindow)||(l.current.contentWindow.postMessage({type:ve.REQUEST_SCROLL_TO_SECTION,sectionId:s},"*"),a==null||a())},[s,a]),c.jsx("div",{className:"w-full h-full bg-background overflow-hidden",children:c.jsx("iframe",{ref:l,src:`/admin/preview/${o}`,className:"w-full h-full border-none",title:"JsonPages Stage"})})},vi=new Set;function g0(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function bc(e,t=[],r={}){return Object.entries(e).forEach(([n,o])=>{const i=[...t,g0(n)];if(typeof o=="string"||typeof o=="number"){r[`--theme-${i.join("-")}`]=String(o);return}o&&typeof o=="object"&&!Array.isArray(o)&&bc(o,i,r)}),r}function We(e,t,r,n){n&&(e[t]=`var(${r})`)}function b0(e){const t=bc(e.tokens),r={...t};return We(r,"--theme-primary","--theme-colors-primary",t["--theme-colors-primary"]),We(r,"--theme-secondary","--theme-colors-secondary",t["--theme-colors-secondary"]),We(r,"--theme-accent","--theme-colors-accent",t["--theme-colors-accent"]),We(r,"--theme-background","--theme-colors-background",t["--theme-colors-background"]),We(r,"--theme-surface","--theme-colors-surface",t["--theme-colors-surface"]),We(r,"--theme-surface-alt","--theme-colors-surface-alt",t["--theme-colors-surface-alt"]),We(r,"--theme-text","--theme-colors-text",t["--theme-colors-text"]),We(r,"--theme-text-muted","--theme-colors-text-muted",t["--theme-colors-text-muted"]),We(r,"--theme-border","--theme-colors-border",t["--theme-colors-border"]),We(r,"--theme-font-primary","--theme-typography-font-family-primary",t["--theme-typography-font-family-primary"]),We(r,"--theme-font-mono","--theme-typography-font-family-mono",t["--theme-typography-font-family-mono"]),We(r,"--theme-font-display","--theme-typography-font-family-display",t["--theme-typography-font-family-display"]),We(r,"--theme-radius-sm","--theme-border-radius-sm",t["--theme-border-radius-sm"]),We(r,"--theme-radius-md","--theme-border-radius-md",t["--theme-border-radius-md"]),We(r,"--theme-radius-lg","--theme-border-radius-lg",t["--theme-border-radius-lg"]),r}const Qn={setTheme:e=>{const t=document.documentElement,r=b0(e);vi.forEach(n=>{t.style.removeProperty(n)}),vi.clear(),Object.entries(r).forEach(([n,o])=>{t.style.setProperty(n,o),vi.add(n)})}};function v0(e,t){if(!t)return e;const r=e[e.length-1];return r&&r.itemId==null&&r.fieldKey===t?e:[...e,{fieldKey:t}]}function vc(e,t){var i,s,a;const r=[];let n=null,o=e;for(;o&&o!==t;){const l=(i=o.getAttribute)==null?void 0:i.call(o,"data-jp-item-id"),d=(s=o.getAttribute)==null?void 0:s.call(o,"data-jp-item-field");if(l&&d&&r.push({fieldKey:d,itemId:l}),n==null){const u=(a=o.getAttribute)==null?void 0:a.call(o,"data-jp-field");u&&(n=u)}o=o.parentElement}return r.reverse(),v0(r,n)}const x0='[data-jp-ignore-select="true"],[data-jp-interactive="true"],.ProseMirror,[contenteditable="true"],button,input,textarea,select,[role="button"],[role="menuitem"]',w0="[data-jp-field],[data-jp-item-id],[data-jp-item-field]",xc=()=>{var h;const[e,t]=b.useState(null),[r,n]=b.useState(null),[o,i]=b.useState({main:[]}),[s,a]=b.useState(null),[l,d]=b.useState(null);if(b.useEffect(()=>{const p=w=>{var m;if(!(w.origin!==window.location.origin||w.source!==window.parent)&&(w.data.type===ve.UPDATE_DRAFTS&&(t(w.data.draft),n(w.data.globalDraft),(m=w.data.menuConfig)!=null&&m.main&&i({main:w.data.menuConfig.main}),w.data.themeConfig&&Qn.setTheme(w.data.themeConfig)),w.data.type===ve.SYNC_SELECTION&&a(w.data.selectedId),w.data.type===ve.REQUEST_SCROLL_TO_SECTION&&d(w.data.sectionId??null),w.data.type===ve.REQUEST_INLINE_FLUSH)){const v=typeof w.data.requestId=="string"?w.data.requestId:null;window.dispatchEvent(new CustomEvent(ve.REQUEST_INLINE_FLUSH,{detail:{requestId:v}})),setTimeout(()=>{window.parent.postMessage({type:ve.INLINE_FLUSHED,requestId:v},window.location.origin)},0)}};return window.addEventListener("message",p),window.parent.postMessage({type:ve.STAGE_READY},"*"),()=>window.removeEventListener("message",p)},[]),b.useEffect(()=>{const p=v=>!!v.closest(w0),w=v=>!!(v.closest('[data-jp-ignore-select="true"]')||v.closest(x0)&&!p(v)||v.closest("a[href]")&&!p(v)),m=v=>{var M,Y,H;const y=v.target;if(w(y)){y.closest("a[href]")&&v.preventDefault();return}const k=v.clientX,x=v.clientY;let S=null,C=y;for(;C&&C!==document.body;){const U=(M=C.getAttribute)==null?void 0:M.call(C,"data-section-id"),B=(Y=C.getAttribute)==null?void 0:Y.call(C,"data-section-type"),T=(H=C.getAttribute)==null?void 0:H.call(C,"data-section-scope");if(U&&B&&T){S=C;break}C=C.parentElement}if(!S)return;v.preventDefault(),v.stopPropagation();const E=S.getAttribute("data-section-id"),j=S.getAttribute("data-section-type"),N=S.getAttribute("data-section-scope");if(!E||!j||!N)return;const _={id:E,type:j,scope:N};if(y===S){window.parent.postMessage({type:ve.SECTION_SELECT,section:_},"*");return}const R=document.elementFromPoint(k,x)??y;if(!R||!S.contains(R)){window.parent.postMessage({type:ve.SECTION_SELECT,section:_},"*");return}if(R===S){window.parent.postMessage({type:ve.SECTION_SELECT,section:_},"*");return}let I=vc(R,S);if(I.length===0&&R){let U=null;const B=T=>{var re,A;const X=T.getBoundingClientRect();if(X.left<=k&&k<=X.right&&X.top<=x&&x<=X.bottom){for(let W=0;W<T.children.length;W++)B(T.children[W]);((re=T.getAttribute)!=null&&re.call(T,"data-jp-item-id")||(A=T.getAttribute)!=null&&A.call(T,"data-jp-field"))&&(U=T)}};B(R),U&&(I=vc(U,S))}const L={type:ve.SECTION_SELECT,section:_};I.length>0&&(L.itemPath=I),window.parent.postMessage(L,"*")};return document.addEventListener("click",m,!0),()=>document.removeEventListener("click",m,!0)},[]),b.useEffect(()=>{if(!l)return;const p=setTimeout(()=>d(null),600);return()=>clearTimeout(p)},[l]),!e||!r)return c.jsx("div",{className:"flex items-center justify-center h-screen w-full bg-zinc-950 text-zinc-500 font-mono text-xs uppercase tracking-widest animate-pulse",children:"Waiting for Studio Signal..."});const u={main:rn((h=r.header)==null?void 0:h.data,o.main)},f=p=>{window.parent.postMessage({type:ve.ACTIVE_SECTION_CHANGED,activeSectionId:p},"*")};return c.jsx(Xr,{mode:"studio",children:c.jsx("div",{className:"jp-ice-active",children:c.jsx(uo,{pageConfig:e,siteConfig:r,menuConfig:u,selectedId:s,scrollToSectionId:l,onActiveSectionChange:f})})})};function y0(e){return e.split("-").map(t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(" ")}const wc=({open:e,onClose:t,sectionTypes:r,sectionTypeLabels:n,onSelect:o})=>{if(b.useEffect(()=>{if(!e)return;const s=a=>{a.key==="Escape"&&t()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,t]),!e)return null;const i=s=>(n==null?void 0:n[s])??y0(s);return c.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-labelledby":"jp-add-section-title",children:[c.jsx("div",{className:"absolute inset-0 bg-zinc-950/80 backdrop-blur-sm",onClick:t,"aria-hidden":"true"}),c.jsxs("div",{className:"relative w-full max-w-md max-h-[85vh] flex flex-col rounded-xl border border-zinc-700 bg-zinc-900 shadow-2xl overflow-hidden",children:[c.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-zinc-800 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"p-1.5 rounded-lg bg-blue-500/20 text-blue-400",children:c.jsx(ao,{size:18})}),c.jsx("h2",{id:"jp-add-section-title",className:"text-sm font-bold text-white",children:"Add section"})]}),c.jsx("button",{type:"button",onClick:t,className:"p-1.5 rounded-md text-zinc-400 hover:text-white hover:bg-zinc-800 transition-colors","aria-label":"Close",children:c.jsx(Ut,{size:18})})]}),c.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:r.length===0?c.jsx("p",{className:"text-xs text-zinc-500 text-center py-8",children:"No section types available. Configure addableSectionTypes or schemas."}):c.jsx("ul",{className:"grid gap-2",role:"listbox",children:r.map(s=>c.jsx("li",{role:"option",children:c.jsxs("button",{type:"button",onClick:()=>{o(s),t()},className:oe("w-full flex items-center gap-3 px-4 py-3 rounded-lg text-left","border border-zinc-700/80 bg-zinc-800/50","hover:border-blue-500/40 hover:bg-zinc-800 transition-colors","focus:outline-none focus:ring-2 focus:ring-blue-500/50 focus:ring-offset-2 focus:ring-offset-zinc-900"),children:[c.jsx("span",{className:"flex items-center justify-center w-9 h-9 rounded-md bg-zinc-700/80 text-zinc-400 text-xs font-mono shrink-0",children:s}),c.jsx("span",{className:"text-sm font-medium text-zinc-200",children:i(s)})]})},s))})}),c.jsx("div",{className:"px-5 py-3 border-t border-zinc-800 shrink-0",children:c.jsx("p",{className:"text-[10px] text-zinc-500 uppercase tracking-wider",children:"Choose a section type to add to the bottom of this page"})})]})]})},yc=()=>c.jsxs("div",{style:{"--local-bg":"var(--color-background)","--local-text":"var(--color-text)","--local-text-muted":"var(--color-text-muted)","--local-primary":"var(--color-primary)","--local-radius-md":"var(--radius-md)"},className:"min-h-screen flex flex-col items-center justify-center bg-[var(--local-bg)] px-6",children:[c.jsx("h1",{className:"text-6xl font-bold text-[var(--local-text)] mb-4",children:"404"}),c.jsx("p",{className:"text-xl text-[var(--local-text-muted)] mb-8",children:"Page not found"}),c.jsx("a",{href:"/",className:"inline-flex items-center gap-2 px-6 py-3 rounded-[var(--local-radius-md)] bg-[var(--local-primary)] text-[var(--local-bg)] font-semibold text-sm hover:opacity-90 transition-opacity",children:"Back to Home"})]});function xi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function kc(e){return e==null?e:JSON.parse(JSON.stringify(e))}function Sc(){if(typeof window>"u")return null;const e=window;return e.__olonWebMcpTools__||(e.__olonWebMcpTools__=new Map),e.__olonWebMcpTools__}function wi(e){return`update-${e}`}function Cc(e){return e.startsWith("update-")?e.slice(7):null}function Ec(e){return{type:"object",additionalProperties:!1,properties:{slug:{type:"string"},sectionId:{type:"string"},scope:{type:"string",enum:["local","global"],default:"local"},data:{type:"object",description:`Full replacement payload validated against the "${e}" section schema.`},itemPath:{type:"array",description:"Optional root-to-leaf path for targeted field updates.",items:{type:"object",additionalProperties:!1,properties:{fieldKey:{type:"string"},itemId:{type:"string"}},required:["fieldKey"]}},fieldKey:{type:"string",description:"Shorthand for a top-level scalar field update when itemPath is omitted."},value:{description:"Value written to the targeted field or array item."}},required:["sectionId"],oneOf:[{required:["data"]},{required:["itemPath","value"]},{required:["fieldKey","value"]}]}}function yi(e,t,r){if(t.length===0)throw new Error("Selection path is empty.");const n=kc(e);let o=n;for(let i=0;i<t.length;i+=1){const s=t[i],a=i===t.length-1;if(!xi(o))throw new Error(`Cannot navigate path segment "${s.fieldKey}" on a non-object value.`);if(s.itemId!=null){const l=o[s.fieldKey];if(!Array.isArray(l))throw new Error(`Field "${s.fieldKey}" is not an array.`);const d=l.findIndex(u=>xi(u)&&String(u.id??"")===String(s.itemId));if(d===-1)throw new Error(`Array item "${s.itemId}" not found under "${s.fieldKey}".`);if(a)return l[d]=r,n;o=l[d];continue}if(a)return o[s.fieldKey]=r,n;o=o[s.fieldKey]}return n}function ki(e,t){if(t.data&&xi(t.data))return kc(t.data);if(Array.isArray(t.itemPath)&&t.itemPath.length>0)return yi(e,t.itemPath,t.value);if(typeof t.fieldKey=="string"&&t.fieldKey.trim().length>0)return yi(e,[{fieldKey:t.fieldKey}],t.value);throw new Error('WebMCP mutation requires either "data", "itemPath", or "fieldKey".')}function Si(){if(typeof window>"u"||typeof navigator>"u")return;const e=Sc();if(!e)return;const t=navigator;t.modelContext||(t.modelContext={registerTool(r){e.set(r.name,r)},unregisterTool(r){e.delete(r)}}),t.modelContextTesting||(t.modelContextTesting={listTools(){return Array.from(e.values()).map(({execute:r,...n})=>n)},async executeTool(r,n){const o=e.get(r);if(!o)throw new Error(`Unknown WebMCP tool: ${r}`);const i=n?JSON.parse(n):{},s=await o.execute(i);return JSON.stringify(s)}})}function Nc(e){var n,o;if(typeof navigator>"u")return()=>{};Si();const t=navigator,r=Sc();return!t.modelContext||!r?()=>{}:((o=(n=t.modelContext).registerTool)==null||o.call(n,e),r.set(e.name,e),()=>{var i,s;r.delete(e.name),(s=(i=t.modelContext)==null?void 0:i.unregisterTool)==null||s.call(i,e.name)})}const k0='/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-900:oklch(39.6% .141 25.723);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-6xl:3.75rem;--text-6xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-black:900;--tracking-tight:-.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-tight:1.25;--leading-snug:1.375;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--blur-sm:8px;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-background:var(--background);--color-foreground:var(--foreground);--color-primary:var(--primary);--color-primary-foreground:var(--primary-foreground);--color-destructive:var(--destructive);--color-ring:var(--ring)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}*{border-color:var(--border)}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.inset-x-0{inset-inline:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.bottom-0{bottom:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.z-0{z-index:0}.z-10{z-index:10}.z-50,.z-\\[50\\]{z-index:50}.z-\\[60\\]{z-index:60}.z-\\[70\\]{z-index:70}.z-\\[100\\]{z-index:100}.z-\\[9998\\]{z-index:9998}.z-\\[9999\\]{z-index:9999}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-4{margin:calc(var(--spacing)*4)}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-1\\.5{margin-inline:calc(var(--spacing)*1.5)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-3{margin-inline:calc(var(--spacing)*3)}.my-1{margin-block:calc(var(--spacing)*1)}.mt-0\\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-1\\.5{margin-top:calc(var(--spacing)*1.5)}.mt-2{margin-top:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.aspect-\\[4\\/3\\]{aspect-ratio:4/3}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.h-1\\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-20{height:calc(var(--spacing)*20)}.h-40{height:calc(var(--spacing)*40)}.h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-screen{height:100vh}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\\[45vh\\]{max-height:45vh}.max-h-\\[85vh\\]{max-height:85vh}.max-h-\\[90vh\\]{max-height:90vh}.max-h-\\[320px\\]{max-height:320px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-16{min-height:calc(var(--spacing)*16)}.min-h-\\[18px\\]{min-height:18px}.min-h-\\[96px\\]{min-height:96px}.min-h-\\[240px\\]{min-height:240px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing)*1)}.w-1\\.5{width:calc(var(--spacing)*1.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\\.5{width:calc(var(--spacing)*3.5)}.w-3\\/4{width:75%}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-7{width:calc(var(--spacing)*7)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-\\[calc\\(100\\%-2rem\\)\\]{width:calc(100% - 2rem)}.w-\\[var\\(--radix-popover-trigger-width\\)\\]{width:var(--radix-popover-trigger-width)}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\\[280px\\]{max-width:280px}.max-w-\\[var\\(--inspector-width\\,280px\\)\\]{max-width:var(--inspector-width,280px)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\\[8rem\\]{min-width:8rem}.min-w-\\[18px\\]{min-width:18px}.min-w-\\[156px\\]{min-width:156px}.min-w-\\[var\\(--radix-popover-trigger-width\\)\\]{min-width:var(--radix-popover-trigger-width)}.min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing)*.5);translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-x-3{--tw-translate-x:calc(var(--spacing)*3);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-col-resize{cursor:col-resize}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize-none{resize:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-nowrap{flex-wrap:nowrap}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-2\\.5{gap:calc(var(--spacing)*2.5)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[inherit\\]{border-radius:inherit}.rounded-\\[var\\(--local-radius-md\\)\\]{border-radius:var(--local-radius-md)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-amber-500\\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-500\\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-blue-600{border-color:var(--color-blue-600)}.border-emerald-500\\/60{border-color:#00bb7f99}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\\/60{border-color:color-mix(in oklab,var(--color-emerald-500)60%,transparent)}}.border-primary{border-color:var(--color-primary)}.border-red-500\\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-red-900\\/30{border-color:#82181a4d}@supports (color:color-mix(in lab,red,red)){.border-red-900\\/30{border-color:color-mix(in oklab,var(--color-red-900)30%,transparent)}}.border-transparent{border-color:#0000}.border-zinc-700{border-color:var(--color-zinc-700)}.border-zinc-700\\/60{border-color:#3f3f4699}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/60{border-color:color-mix(in oklab,var(--color-zinc-700)60%,transparent)}}.border-zinc-700\\/80{border-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.border-zinc-700\\/80{border-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.border-zinc-800{border-color:var(--color-zinc-800)}.border-zinc-800\\/50{border-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/50{border-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.border-zinc-800\\/60{border-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.border-zinc-800\\/60{border-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.border-l-transparent{border-left-color:#0000}.bg-\\[var\\(--color-background\\)\\]{background-color:var(--color-background)}.bg-\\[var\\(--local-bg\\)\\]{background-color:var(--local-bg)}.bg-\\[var\\(--local-primary\\)\\]{background-color:var(--local-primary)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/5{background-color:color-mix(in oklab,var(--color-amber-500)5%,transparent)}}.bg-amber-500\\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-background{background-color:var(--color-background)}.bg-black{background-color:var(--color-black)}.bg-black\\/0{background-color:#0000}@supports (color:color-mix(in lab,red,red)){.bg-black\\/0{background-color:color-mix(in oklab,var(--color-black)0%,transparent)}}.bg-black\\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\\/20{background-color:color-mix(in oklab,var(--color-black)20%,transparent)}}.bg-black\\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\\/60{background-color:color-mix(in oklab,var(--color-black)60%,transparent)}}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-500\\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/15{background-color:color-mix(in oklab,var(--color-blue-500)15%,transparent)}}.bg-blue-500\\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-blue-500\\/\\[0\\.04\\]{background-color:#3080ff0a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\\/\\[0\\.04\\]{background-color:color-mix(in oklab,var(--color-blue-500)4%,transparent)}}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-600\\/10{background-color:#155dfc1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-600\\/10{background-color:color-mix(in oklab,var(--color-blue-600)10%,transparent)}}.bg-destructive\\/15{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.bg-destructive\\/15{background-color:color-mix(in oklab,var(--color-destructive)15%,transparent)}}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-primary,.bg-primary\\/10{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/10{background-color:color-mix(in oklab,var(--color-primary)10%,transparent)}}.bg-primary\\/\\[0\\.08\\]{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.bg-primary\\/\\[0\\.08\\]{background-color:color-mix(in oklab,var(--color-primary)8%,transparent)}}.bg-red-500\\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\\/15{background-color:color-mix(in oklab,var(--color-red-500)15%,transparent)}}.bg-red-900\\/10{background-color:#82181a1a}@supports (color:color-mix(in lab,red,red)){.bg-red-900\\/10{background-color:color-mix(in oklab,var(--color-red-900)10%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/15{background-color:#ffffff26}@supports (color:color-mix(in lab,red,red)){.bg-white\\/15{background-color:color-mix(in oklab,var(--color-white)15%,transparent)}}.bg-white\\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-white\\/\\[0\\.01\\]{background-color:#ffffff03}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.01\\]{background-color:color-mix(in oklab,var(--color-white)1%,transparent)}}.bg-white\\/\\[0\\.02\\]{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.02\\]{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.bg-white\\/\\[0\\.03\\]{background-color:#ffffff08}@supports (color:color-mix(in lab,red,red)){.bg-white\\/\\[0\\.03\\]{background-color:color-mix(in oklab,var(--color-white)3%,transparent)}}.bg-zinc-700{background-color:var(--color-zinc-700)}.bg-zinc-700\\/80{background-color:#3f3f46cc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-700\\/80{background-color:color-mix(in oklab,var(--color-zinc-700)80%,transparent)}}.bg-zinc-800{background-color:var(--color-zinc-800)}.bg-zinc-800\\/30{background-color:#27272a4d}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/30{background-color:color-mix(in oklab,var(--color-zinc-800)30%,transparent)}}.bg-zinc-800\\/50{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/50{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.bg-zinc-800\\/60{background-color:#27272a99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/60{background-color:color-mix(in oklab,var(--color-zinc-800)60%,transparent)}}.bg-zinc-800\\/80{background-color:#27272acc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-800\\/80{background-color:color-mix(in oklab,var(--color-zinc-800)80%,transparent)}}.bg-zinc-900{background-color:var(--color-zinc-900)}.bg-zinc-900\\/20{background-color:#18181b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/20{background-color:color-mix(in oklab,var(--color-zinc-900)20%,transparent)}}.bg-zinc-900\\/40{background-color:#18181b66}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/40{background-color:color-mix(in oklab,var(--color-zinc-900)40%,transparent)}}.bg-zinc-900\\/50{background-color:#18181b80}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/50{background-color:color-mix(in oklab,var(--color-zinc-900)50%,transparent)}}.bg-zinc-900\\/60{background-color:#18181b99}@supports (color:color-mix(in lab,red,red)){.bg-zinc-900\\/60{background-color:color-mix(in oklab,var(--color-zinc-900)60%,transparent)}}.bg-zinc-950{background-color:var(--color-zinc-950)}.bg-zinc-950\\/80{background-color:#09090bcc}@supports (color:color-mix(in lab,red,red)){.bg-zinc-950\\/80{background-color:color-mix(in oklab,var(--color-zinc-950)80%,transparent)}}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black\\/70{--tw-gradient-from:#000000b3}@supports (color:color-mix(in lab,red,red)){.from-black\\/70{--tw-gradient-from:color-mix(in oklab,var(--color-black)70%,transparent)}}.from-black\\/70{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-black\\/80{--tw-gradient-from:#000c}@supports (color:color-mix(in lab,red,red)){.from-black\\/80{--tw-gradient-from:color-mix(in oklab,var(--color-black)80%,transparent)}}.from-black\\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-1\\.5{padding:calc(var(--spacing)*1.5)}.p-2\\.5{padding:calc(var(--spacing)*2.5)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.p-px{padding:1px}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-3\\.5{padding-inline:calc(var(--spacing)*3.5)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-7{padding-block:calc(var(--spacing)*7)}.py-8{padding-block:calc(var(--spacing)*8)}.py-10{padding-block:calc(var(--spacing)*10)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-4{padding-top:calc(var(--spacing)*4)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-1{padding-left:calc(var(--spacing)*1)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-9{padding-left:calc(var(--spacing)*9)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.01em\\]{--tw-tracking:.01em;letter-spacing:.01em}.tracking-\\[0\\.02em\\]{--tw-tracking:.02em;letter-spacing:.02em}.tracking-\\[0\\.04em\\]{--tw-tracking:.04em;letter-spacing:.04em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.06em\\]{--tw-tracking:.06em;letter-spacing:.06em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.whitespace-nowrap{white-space:nowrap}.text-\\[var\\(--local-bg\\)\\]{color:var(--local-bg)}.text-\\[var\\(--local-text\\)\\]{color:var(--local-text)}.text-\\[var\\(--local-text-muted\\)\\]{color:var(--local-text-muted)}.text-amber-200{color:var(--color-amber-200)}.text-amber-500{color:var(--color-amber-500)}.text-amber-500\\/70{color:#f99c00b3}@supports (color:color-mix(in lab,red,red)){.text-amber-500\\/70{color:color-mix(in oklab,var(--color-amber-500)70%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-destructive{color:var(--color-destructive)}.text-emerald-400{color:var(--color-emerald-400)}.text-foreground{color:var(--color-foreground)}.text-primary{color:var(--color-primary)}.text-primary-foreground{color:var(--color-primary-foreground)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-zinc-200{color:var(--color-zinc-200)}.text-zinc-300{color:var(--color-zinc-300)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-600\\/50{color:#52525c80}@supports (color:color-mix(in lab,red,red)){.text-zinc-600\\/50{color:color-mix(in oklab,var(--color-zinc-600)50%,transparent)}}.text-zinc-700{color:var(--color-zinc-700)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\\[0_0_8px_rgba\\(245\\,158\\,11\\,0\\.5\\)\\]{--tw-shadow:0 0 8px var(--tw-shadow-color,#f59e0b80);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\\/30{--tw-shadow-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.shadow-black\\/30{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-black)30%,transparent)var(--tw-shadow-alpha),transparent)}}.shadow-primary\\/20{--tw-shadow-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.shadow-primary\\/20{--tw-shadow-color:color-mix(in oklab,color-mix(in oklab,var(--color-primary)20%,transparent)var(--tw-shadow-alpha),transparent)}}.ring-blue-500{--tw-ring-color:var(--color-blue-500)}.ring-blue-500\\/40{--tw-ring-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.ring-blue-500\\/40{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.ring-zinc-800{--tw-ring-color:var(--color-zinc-800)}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.ring-offset-zinc-900{--tw-ring-offset-color:var(--color-zinc-900)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.brightness-\\[0\\.6\\]{--tw-brightness:brightness(.6);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.brightness-\\[0\\.85\\]{--tw-brightness:brightness(.85);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition-\\[border-color\\,opacity\\]{transition-property:border-color,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[filter\\]{transition-property:filter;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:border-dashed:is(:where(.group):hover *){--tw-border-style:dashed;border-style:dashed}.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.group-hover\\:border-blue-400\\/50:is(:where(.group):hover *){border-color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\\:brightness-100:is(:where(.group):hover *){--tw-brightness:brightness(100%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.hover\\:scale-\\[1\\.02\\]:hover{scale:1.02}.hover\\:border-blue-500\\/30:hover{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/30:hover{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.hover\\:border-blue-500\\/40:hover{border-color:#3080ff66}@supports (color:color-mix(in lab,red,red)){.hover\\:border-blue-500\\/40:hover{border-color:color-mix(in oklab,var(--color-blue-500)40%,transparent)}}.hover\\:border-zinc-600:hover{border-color:var(--color-zinc-600)}.hover\\:border-zinc-700:hover{border-color:var(--color-zinc-700)}.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:#3080ff08}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-500\\/\\[0\\.03\\]:hover{background-color:color-mix(in oklab,var(--color-blue-500)3%,transparent)}}.hover\\:bg-blue-600\\/20:hover{background-color:#155dfc33}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-blue-600\\/20:hover{background-color:color-mix(in oklab,var(--color-blue-600)20%,transparent)}}.hover\\:bg-destructive\\/25:hover{background-color:var(--color-destructive)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-destructive\\/25:hover{background-color:color-mix(in oklab,var(--color-destructive)25%,transparent)}}.hover\\:bg-primary\\/40:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/40:hover{background-color:color-mix(in oklab,var(--color-primary)40%,transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab,var(--color-primary)90%,transparent)}}.hover\\:bg-red-500\\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\\:bg-red-500\\/25:hover{background-color:#fb2c3640}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-red-500\\/25:hover{background-color:color-mix(in oklab,var(--color-red-500)25%,transparent)}}.hover\\:bg-white\\/30:hover{background-color:#ffffff4d}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/30:hover{background-color:color-mix(in oklab,var(--color-white)30%,transparent)}}.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:#ffffff05}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-white\\/\\[0\\.02\\]:hover{background-color:color-mix(in oklab,var(--color-white)2%,transparent)}}.hover\\:bg-zinc-600:hover{background-color:var(--color-zinc-600)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-800\\/40:hover{background-color:#27272a66}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/40:hover{background-color:color-mix(in oklab,var(--color-zinc-800)40%,transparent)}}.hover\\:bg-zinc-800\\/50:hover{background-color:#27272a80}@supports (color:color-mix(in lab,red,red)){.hover\\:bg-zinc-800\\/50:hover{background-color:color-mix(in oklab,var(--color-zinc-800)50%,transparent)}}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-blue-400:hover{color:var(--color-blue-400)}.hover\\:text-destructive:hover{color:var(--color-destructive)}.hover\\:text-primary:hover{color:var(--color-primary)}.hover\\:text-red-200:hover{color:var(--color-red-200)}.hover\\:text-red-400:hover{color:var(--color-red-400)}.hover\\:text-red-500:hover{color:var(--color-red-500)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:text-zinc-200:hover{color:var(--color-zinc-200)}.hover\\:text-zinc-300:hover{color:var(--color-zinc-300)}.hover\\:text-zinc-400:hover{color:var(--color-zinc-400)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:ring-zinc-600:hover{--tw-ring-color:var(--color-zinc-600)}}.focus\\:bg-zinc-800:focus{background-color:var(--color-zinc-800)}.focus\\:text-white:focus{color:var(--color-white)}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.focus\\:ring-blue-500\\/50:focus{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.focus\\:ring-blue-600:focus{--tw-ring-color:var(--color-blue-600)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\\:ring-offset-zinc-900:focus{--tw-ring-offset-color:var(--color-zinc-900)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\\:border-zinc-600:focus-visible{border-color:var(--color-zinc-600)}.focus-visible\\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\\:ring-blue-500:focus-visible{--tw-ring-color:var(--color-blue-500)}.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:#3080ffcc}@supports (color:color-mix(in lab,red,red)){.focus-visible\\:ring-blue-500\\/80:focus-visible{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)80%,transparent)}}.focus-visible\\:ring-blue-600:focus-visible{--tw-ring-color:var(--color-blue-600)}.focus-visible\\:ring-ring:focus-visible{--tw-ring-color:var(--color-ring)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\\:ring-offset-zinc-900:focus-visible{--tw-ring-offset-color:var(--color-zinc-900)}.focus-visible\\:ring-offset-zinc-950:focus-visible{--tw-ring-offset-color:var(--color-zinc-950)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.focus-visible\\:ring-inset:focus-visible{--tw-ring-inset:inset}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-primary\\/60:active{background-color:var(--color-primary)}@supports (color:color-mix(in lab,red,red)){.active\\:bg-primary\\/60:active{background-color:color-mix(in oklab,var(--color-primary)60%,transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-20:disabled{opacity:.2}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-50:disabled{opacity:.5}.data-\\[disabled\\]\\:pointer-events-none[data-disabled]{pointer-events:none}.data-\\[disabled\\]\\:opacity-50[data-disabled]{opacity:.5}.data-\\[side\\=bottom\\]\\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=left\\]\\:-translate-x-1[data-side=left]{--tw-translate-x:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=right\\]\\:translate-x-1[data-side=right]{--tw-translate-x:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[side\\=top\\]\\:-translate-y-1[data-side=top]{--tw-translate-y:calc(var(--spacing)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\\[state\\=open\\]\\:border-zinc-800[data-state=open]{border-color:var(--color-zinc-800)}.data-\\[state\\=open\\]\\:bg-zinc-950[data-state=open]{background-color:var(--color-zinc-950)}.data-\\[state\\=open\\]\\:text-zinc-100[data-state=open]{color:var(--color-zinc-100)}@media(min-width:40rem){.sm\\:max-w-\\[280px\\]{max-width:280px}}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&\\>span\\]\\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\\[\\&\\>span\\]\\:flex>span{display:flex}.\\[\\&\\>span\\]\\:items-center>span{align-items:center}.\\[\\&\\>span\\]\\:gap-2>span{gap:calc(var(--spacing)*2)}}:root{--background:oklch(14.1% .005 285.823);--foreground:oklch(98.5% 0 0);--card:oklch(21% .006 285.885);--card-foreground:oklch(98.5% 0 0);--popover:oklch(21% .006 285.885);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(42% .18 266);--primary-foreground:oklch(97% .014 254.604);--secondary:oklch(27.4% .006 286.033);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27.4% .006 286.033);--muted-foreground:oklch(70.5% .015 286.067);--accent:oklch(42% .18 266);--accent-foreground:oklch(97% .014 254.604);--destructive:oklch(70.4% .191 22.216);--destructive-foreground:oklch(97% .014 254.604);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.2% .016 285.938);--radius:.5rem;--jp-inspector-label-size:11px;--jp-inspector-field-size:13px;font-family:ui-sans-serif,system-ui,sans-serif}[data-radix-portal]{z-index:9999!important}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"<color>";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"<length-percentage>";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"<length-percentage>";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"<length-percentage>";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}';class S0 extends b.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("[JsonPages Engine]",t,r)}render(){return this.state.hasError&&this.state.error?c.jsxs("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,backgroundColor:"#0f172a",color:"#e2e8f0",fontFamily:"ui-sans-serif, system-ui, sans-serif"},children:[c.jsx("h1",{style:{fontSize:"1.25rem",fontWeight:700,marginBottom:8},children:"JsonPages Engine Error"}),c.jsx("pre",{style:{maxWidth:"100%",overflow:"auto",padding:16,backgroundColor:"rgba(0,0,0,0.3)",borderRadius:8,fontSize:12,marginTop:8},children:this.state.error.message})]}):this.props.children}}function Fr(e){return e.split("/").map(t=>t.trim()).filter(Boolean).join("/")}function jc(e,t=""){const r=Fr(t);let o=e.replace(/\/+/g,"/");if(r){const s=`/${r}`;o===s?o="/":o.startsWith(`${s}/`)&&(o=o.slice(s.length))}return Fr(o)||"home"}function Ci(e,t){const r=Fr(t)||"home";return e[r]}function Ei(e,t){return rn(e,t)}function Ni(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function eo(e,t){if(typeof document>"u")return;const r=`link[rel="${e}"]`;let n=document.head.querySelector(r);n||(n=document.createElement("link"),n.rel=e,document.head.appendChild(n)),n.href=t}function Ac(e,t,r){if(typeof document>"u")return;const n="olonjs-webmcp-jsonld";let o=document.getElementById(n);o||(o=document.createElement("script"),o.type="application/ld+json",o.id=n,document.head.appendChild(o)),o.textContent=JSON.stringify({"@context":"https://schema.org","@type":"WebPage",name:e,description:t,url:r})}function Tc(e){return`/mcp-manifests/${e}.json`}function zc(e){return`/schemas/${e}.schema.json`}const Pc=({pageRegistry:e,siteConfig:t,menuConfig:r,themeConfig:n,refDocuments:o,tenantCss:i,adminCss:s,NotFoundComponent:a})=>{const l=Je.useLocation(),d=jc(l.pathname),u=b.useMemo(()=>It({pages:e,siteConfig:t,themeConfig:n,menuConfig:r,refDocuments:o}),[e,t,n,r,o]),f=Ci(u.pages,d);return b.useEffect(()=>{var h;try{(h=u.themeConfig)!=null&&h.tokens&&Qn.setTheme(u.themeConfig)}catch(p){console.warn("[JsonPages] visitor theme resolution failed",p)}},[u.themeConfig]),b.useEffect(()=>{var w,m;if(!f)return;const h=typeof((w=f.meta)==null?void 0:w.title)=="string"?f.meta.title:d,p=typeof((m=f.meta)==null?void 0:m.description)=="string"?f.meta.description:"";eo("mcp-manifest",Tc(d)),eo("olon-contract",zc(d)),Ac(h,p,d==="home"?"/":`/${d}`)},[f,d]),f?c.jsx(on,{mode:"tenant",tenantCss:i,adminCss:s,children:c.jsx(Xr,{mode:"visitor",children:c.jsx(uo,{pageConfig:f,siteConfig:u.siteConfig,menuConfig:u.menuConfig})})}):c.jsx(a,{})},Oc=({pageRegistry:e,schemas:t,siteConfig:r,menuConfig:n,themeConfig:o,refDocuments:i,tenantCss:s,adminCss:a,addSectionConfig:l,addableSectionTypes:d,webMcp:u,saveToFile:f,hotSave:h,showLegacySave:p=!0,showHotSave:w=!1})=>{var Ee;const m=Je.useLocation(),v=jc(m.pathname,"admin"),y=Je.useNavigate(),k=Object.keys(e).sort((z,O)=>z==="home"?-1:O==="home"?1:z.localeCompare(O)),[x,S]=b.useState(null),[C,E]=b.useState(!1),[j,N]=b.useState(!1),[_,R]=b.useState(!1),[I,L]=b.useState(!1),[M,Y]=b.useState(()=>{try{const z=JSON.parse(JSON.stringify(r??{}));return z.identity||(z.identity={title:"Site"}),z.pages||(z.pages=[]),z}catch{return{identity:{title:"Site"},pages:[]}}}),[H,U]=b.useState(null),[B,T]=b.useState(null),[X,re]=b.useState(null),[A,W]=b.useState(null),[q,G]=b.useState(!1),[me,se]=b.useState(400),P=b.useMemo(()=>It({pages:x?{[v]:x}:{},siteConfig:M,themeConfig:o,menuConfig:n,refDocuments:i}),[x,M,o,n,i,v]),J=x?P.pages[v]??x:null,te=b.useRef(x),F=b.useRef(M),ne=360,Q=920;b.useEffect(()=>{te.current=x},[x]),b.useEffect(()=>{F.current=M},[M]);const xe=b.useCallback(z=>{z.preventDefault();const O=z.currentTarget;O.setPointerCapture(z.pointerId);const $=z.clientX,Z=me,ce=be=>{const Ne=$-be.clientX,it=Math.min(Q,Math.max(ne,Z+Ne));se(it)},de=()=>{O.releasePointerCapture(z.pointerId),O.removeEventListener("pointermove",ce),O.removeEventListener("pointerup",de),O.removeEventListener("pointercancel",de),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",O.addEventListener("pointermove",ce),O.addEventListener("pointerup",de),O.addEventListener("pointercancel",de)},[me]),ge=x?[...M.header?[{id:M.header.id,type:M.header.type,scope:"global",title:"Header"}]:[],...x.sections.map(z=>{var O,$;return{id:z.id,type:z.type,scope:"local",title:((O=z.data)==null?void 0:O.title)??(($=z.data)==null?void 0:$.titleHighlight)}}),...M.footer?[{id:M.footer.id,type:M.footer.type,scope:"global",title:"Footer"}]:[]]:[];b.useEffect(()=>{const z=Ci(e,v);z&&S(JSON.parse(JSON.stringify(z))),U(null),T(null),E(!1)},[v,e]);const ze=b.useCallback(()=>{const z=Ci(e,v);z&&S(JSON.parse(JSON.stringify(z))),U(null),T(null),E(!1)},[v,e]),Oe=b.useCallback((z,O,$)=>{const Z=[...$.sections],ce=Z.findIndex(Ne=>Ne.id===z);if(ce===-1||O<0||O>=Z.length)return;const[de]=Z.splice(ce,1),be=O>ce?O-1:O;Z.splice(Math.min(be,Z.length),0,de),S({...$,sections:Z}),E(!0)},[]),Be=b.useCallback(z=>{if(z.origin===window.location.origin){if(z.data.type===ve.SECTION_SELECT){U(z.data.section);const O=z.data.itemPath;Array.isArray(O)&&O.length>0?T(O.map($=>({fieldKey:$.fieldKey,...$.itemId!=null?{itemId:String($.itemId)}:{}}))):T(null)}if(z.data.type===ve.INLINE_FIELD_UPDATE){const O=typeof z.data.sectionId=="string"?z.data.sectionId:null,$=typeof z.data.fieldKey=="string"?z.data.fieldKey:null;O&&$&&(S(Z=>{if(!Z)return Z;const ce={...Z,sections:Z.sections.map(de=>de.id===O?{...de,data:{...de.data,[$]:z.data.value}}:de)};return te.current=ce,ce}),E(!0))}if(z.data.type===ve.ACTIVE_SECTION_CHANGED&&re(z.data.activeSectionId??null),z.data.type==="jsonpages:section-reorder"&&te.current){const{sectionId:O,newIndex:$}=z.data;typeof O=="string"&&typeof $=="number"&&$>=0&&Oe(O,$,te.current)}if(z.data.type===ve.WEBMCP_TOOL_CALL){const O=typeof z.data.requestId=="string"?z.data.requestId:crypto.randomUUID(),$=typeof z.data.toolName=="string"?z.data.toolName:"";D($,z.data.args).then(Z=>{window.postMessage({type:ve.WEBMCP_TOOL_RESULT,requestId:O,toolName:$,result:Z,ok:!0},window.location.origin)}).catch(Z=>{const ce=Z instanceof Error?Z.message:String(Z);window.postMessage({type:ve.WEBMCP_TOOL_RESULT,requestId:O,toolName:$,ok:!1,error:ce},window.location.origin)})}}},[Oe,D]);b.useEffect(()=>(window.addEventListener("message",Be),()=>window.removeEventListener("message",Be)),[Be]),b.useEffect(()=>{if(!(u!=null&&u.enabled))return;Si();const z=te.current;if(!z)return;const $=Array.from(new Set([...F.current.header?[F.current.header.type]:[],...F.current.footer?[F.current.footer.type]:[],...z.sections.map(Z=>Z.type)])).map(Z=>Nc({name:wi(Z),description:`Update a ${Z} section in OlonJS Studio and persist immediately to file.`,inputSchema:Ec(Z),execute:ce=>D(wi(Z),ce)}));return()=>{for(const Z of $)Z()}},[u==null?void 0:u.enabled,v,x,M,D]);const jt=b.useCallback(z=>{const O=ge.find($=>$.id===z);O&&U({id:O.id,type:O.type,scope:O.scope}),T(null),W(z)},[ge]),Xe=b.useCallback(()=>{W(null)},[]),He=b.useCallback(z=>{S(O=>O&&{...O,sections:O.sections.filter($=>$.id!==z)}),E(!0),U(O=>(O==null?void 0:O.id)===z?null:O)},[]),Ve=z=>{if(!(!H||!x))if(E(!0),H.scope==="global")H.type==="header"&&M.header!=null?Y({...M,header:{...M.header,data:z}}):H.type==="footer"&&M.footer!=null&&Y({...M,footer:{...M.footer,data:z}});else{const O=x.sections.map($=>$.id===H.id?{...$,data:z}:$);S({...x,sections:O})}},mt=b.useCallback((z,O,$,Z)=>{var ce,de;if(E(!0),O==="global")((ce=M.header)==null?void 0:ce.id)===z?Y({...M,header:{...M.header,data:Z}}):((de=M.footer)==null?void 0:de.id)===z&&Y({...M,footer:{...M.footer,data:Z}});else if(x){const be=x.sections.map(Ne=>Ne.id===z?{...Ne,data:Z}:Ne);S({...x,sections:be})}},[x,M]),ot=b.useCallback(async()=>{const z=document.querySelector("iframe");if(!(z!=null&&z.contentWindow))return;const O=crypto.randomUUID();await new Promise($=>{var de;let Z=!1;const ce=be=>{var Ne,it;be.origin===window.location.origin&&((Ne=be.data)==null?void 0:Ne.type)===ve.INLINE_FLUSHED&&((it=be.data)==null?void 0:it.requestId)===O&&(Z=!0,window.removeEventListener("message",ce),$())};window.addEventListener("message",ce),(de=z.contentWindow)==null||de.postMessage({type:ve.REQUEST_INLINE_FLUSH,requestId:O},"*"),window.setTimeout(()=>{Z||(window.removeEventListener("message",ce),$())},400)})},[]),At=b.useCallback(async(z,O)=>{var de;if(!f)throw new Error("saveToFile is not configured for this tenant.");const $=It({pages:{[v]:z},siteConfig:O,themeConfig:o,menuConfig:n,refDocuments:i}),Z=(de=$.siteConfig.header)==null?void 0:de.data,ce={page:z,site:O,menu:{main:Ei(Z,n.main)},theme:$.themeConfig};await f(ce,v),E(!1),N(!0),typeof window<"u"&&window.setTimeout(()=>N(!1),2500)},[f,v,o,n,i]),Wr=b.useCallback(async(z,O)=>{var Re,Le;if(!f)throw new Error("WebMCP requires saveToFile persistence in Studio mode.");if(!Ni(O)||typeof O.sectionId!="string")throw new Error("WebMCP mutation requires a sectionId.");const $=O,Z=typeof $.slug=="string"?Fr($.slug):v;if(Z!==v)throw new Error(`WebMCP slug mismatch. Active Studio slug is "${v}", received "${Z}".`);await ot();const ce=te.current,de=F.current;if(!ce)throw new Error("Studio draft is not ready yet.");const be=t[z];if(!be||typeof be.parse!="function")throw new Error(`Missing schema for section type "${z}".`);const Ne=$.scope==="global"?"global":"local";let it=ce,Ce=de;if(Ne==="global"){const Se=((Re=de.header)==null?void 0:Re.id)===$.sectionId?de.header:((Le=de.footer)==null?void 0:Le.id)===$.sectionId?de.footer:null;if(!Se)throw new Error(`Global section "${$.sectionId}" was not found.`);if(Se.type!==z)throw new Error(`Section "${$.sectionId}" is type "${Se.type}", not "${z}".`);const $e=Ni(Se.data)?Se.data:{},De=ki($e,$),Ke=be.parse(De),Ue={...Se,data:Ke};Ce={...de,...Se.type==="header"?{header:Ue}:{footer:Ue}},F.current=Ce,Y(Ce)}else{const Se=ce.sections.find(Ue=>Ue.id===$.sectionId);if(!Se)throw new Error(`Local section "${$.sectionId}" was not found in page "${v}".`);if(Se.type!==z)throw new Error(`Section "${$.sectionId}" is type "${Se.type}", not "${z}".`);const $e=Ni(Se.data)?Se.data:{},De=ki($e,$),Ke=be.parse(De);it={...ce,sections:ce.sections.map(Ue=>Ue.id===$.sectionId?{...Ue,data:Ke}:Ue)},te.current=it,S(it)}return U({id:$.sectionId,type:z,scope:Ne}),T(Array.isArray($.itemPath)?$.itemPath:null),E(!0),await At(it,Ce),{content:[{type:"text",text:JSON.stringify({ok:!0,slug:v,sectionId:$.sectionId,sectionType:z,scope:Ne})}],isError:!1}},[f,v,ot,t,At]);async function D(z,O){const $=Cc(z);if(!$)throw new Error(`Unknown WebMCP tool "${z}".`);return Wr($,O)}const ee=async()=>{var de;if(!f)return;await ot();const z=te.current,O=F.current;if(!z)return;const $=It({pages:{[v]:z},siteConfig:O,themeConfig:o,menuConfig:n,refDocuments:i}),Z=(de=$.siteConfig.header)==null?void 0:de.data,ce={page:z,site:O,menu:{main:Ei(Z,n.main)},theme:$.themeConfig};f(ce,v).then(()=>{E(!1),N(!0),typeof window<"u"&&window.setTimeout(()=>N(!1),2500)}).catch(be=>{console.error("[JsonPages] saveToFile failed",be);const Ne=be instanceof Error?be.message:String(be);alert(`Save to file failed: ${Ne}`)})},ie=async()=>{var de;if(!h)return;await ot();const z=te.current,O=F.current;if(!z)return;const $=It({pages:{[v]:z},siteConfig:O,themeConfig:o,menuConfig:n,refDocuments:i}),Z=(de=$.siteConfig.header)==null?void 0:de.data,ce={page:z,site:O,menu:{main:Ei(Z,n.main)},theme:$.themeConfig};L(!0),h(ce,v).then(()=>{E(!1),R(!0),typeof window<"u"&&window.setTimeout(()=>R(!1),2500)}).catch(be=>{console.error("[JsonPages] hotSave failed",be);const Ne=be instanceof Error?be.message:String(be);alert(`Hot save failed: ${Ne}`)}).finally(()=>{L(!1)})},fe=z=>{var Z;if(!x)return;const O=((Z=l==null?void 0:l.getDefaultSectionData)==null?void 0:Z.call(l,z))??{},$={id:crypto.randomUUID(),type:z,data:O,settings:void 0};S({...x,sections:[...x.sections,$]}),E(!0),U({id:$.id,type:z,scope:"local"})};if(b.useEffect(()=>{var Z,ce;const z=J??x,O=typeof((Z=z==null?void 0:z.meta)==null?void 0:Z.title)=="string"?z.meta.title:v,$=typeof((ce=z==null?void 0:z.meta)==null?void 0:ce.description)=="string"?z.meta.description:"";eo("mcp-manifest",Tc(v)),eo("olon-contract",zc(v)),Ac(O,$,`/admin${v==="home"?"":`/${v}`}`)},[x,J,v]),!x)return c.jsx("div",{children:"Loading Studio..."});const Ie=(H==null?void 0:H.scope)==="global"?{sections:[P.siteConfig.header,P.siteConfig.footer].filter(z=>z!=null)}:J??x,ye=[...P.siteConfig.header?[P.siteConfig.header]:[],...((Ee=J??x)==null?void 0:Ee.sections)??[],...P.siteConfig.footer?[P.siteConfig.footer]:[]];return c.jsx(on,{mode:"admin",tenantCss:s,adminCss:a,children:c.jsx(Xr,{mode:"studio",children:c.jsxs("div",{className:"flex flex-col h-screen w-screen bg-background text-foreground overflow-hidden",children:[c.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[c.jsx("main",{className:"flex-1 min-w-0 relative bg-zinc-900/50 overflow-hidden",children:c.jsx(gc,{draft:J??x,globalDraft:P.siteConfig,menuConfig:P.menuConfig,themeConfig:P.themeConfig,slug:v,selectedId:H==null?void 0:H.id,scrollToSectionId:A,onScrollRequested:Xe})}),c.jsxs("div",{className:"flex shrink-0 relative h-full z-10",style:{width:me,minWidth:ne,maxWidth:Q},children:[c.jsx("div",{role:"separator","aria-label":"Resize inspector",className:"absolute left-0 top-0 bottom-0 w-1.5 cursor-col-resize hover:bg-primary/40 active:bg-primary/60 transition-colors shrink-0",style:{zIndex:9999},onPointerDown:xe}),c.jsx(mc,{selectedSection:H,pageData:Ie,allSectionsData:ye,onUpdate:Ve,onUpdateSection:mt,onClose:()=>{U(null),T(null)},expandedItemPath:B,onReorderSection:x?(z,O)=>Oe(z,O,x):void 0,allLayers:ge,activeSectionId:X,onRequestScrollToSection:jt,onDeleteSection:x?He:void 0,onAddSection:d.length>0?()=>G(!0):void 0,hasChanges:C,onSaveToFile:f!=null?ee:void 0,saveSuccessFeedback:j,onHotSave:h!=null?ie:void 0,hotSaveSuccessFeedback:_,hotSaveInProgress:I,showLegacySave:p,showHotSave:w,onResetToFile:ze,pageSlugs:k,currentSlug:v,onPageChange:k.length>1?z=>{const O=Fr(z);y(O==="home"?"/admin":`/admin/${O}`)}:void 0})]})]}),c.jsx(wc,{open:q,onClose:()=>G(!1),sectionTypes:d,sectionTypeLabels:l==null?void 0:l.sectionTypeLabels,onSelect:fe})]})})})},Ic=({tenantCss:e,adminCss:t})=>c.jsx(on,{mode:"tenant",tenantCss:e,adminCss:t,children:c.jsx(xc,{})});function C0({config:e}){var k,x,S,C;const{registry:t={},schemas:r={},pages:n={},siteConfig:o,themeConfig:i,menuConfig:s,refDocuments:a,themeCss:l,addSection:d,NotFoundComponent:u=yc}=e,f=(d==null?void 0:d.addableSectionTypes)??Object.keys(r).filter(E=>E!=="header"&&E!=="footer"),h={saveToFile:(k=e.persistence)==null?void 0:k.saveToFile,hotSave:(x=e.persistence)==null?void 0:x.hotSave,showLegacySave:((S=e.persistence)==null?void 0:S.showLegacySave)??!0,showHotSave:((C=e.persistence)==null?void 0:C.showHotSave)??!1},p=typeof(l==null?void 0:l.tenant)=="string"?l.tenant:"",w=typeof(l==null?void 0:l.admin)=="string"?l.admin:k0,m=b.useMemo(()=>It({pages:n,siteConfig:o,themeConfig:i,menuConfig:s,refDocuments:a}),[n,o,i,s,a]),[v,y]=b.useState(!1);return b.useEffect(()=>{var E;try{(E=m.themeConfig)!=null&&E.tokens&&Qn.setTheme(m.themeConfig)}catch(j){console.warn("[JsonPages] setTheme failed",j)}y(!0)},[m.themeConfig]),v?c.jsx(S0,{children:c.jsx(Zi,{config:{registry:t,schemas:r,tenantId:e.tenantId??"default",assets:e.assets,overlayDisabledSectionTypes:e.overlayDisabledSectionTypes},children:c.jsx(Je.BrowserRouter,{children:c.jsxs(Je.Routes,{children:[c.jsx(Je.Route,{path:"/",element:c.jsx(Pc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,NotFoundComponent:u})}),c.jsx(Je.Route,{path:"/*",element:c.jsx(Pc,{pageRegistry:n,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,NotFoundComponent:u})}),c.jsx(Je.Route,{path:"/admin",element:c.jsx(Oc,{pageRegistry:n,schemas:r,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,addSectionConfig:d,addableSectionTypes:f,webMcp:e.webmcp,saveToFile:h.saveToFile,hotSave:h.hotSave,showLegacySave:h.showLegacySave,showHotSave:h.showHotSave})}),c.jsx(Je.Route,{path:"/admin/*",element:c.jsx(Oc,{pageRegistry:n,schemas:r,siteConfig:o,menuConfig:s,themeConfig:m.themeConfig,refDocuments:a,tenantCss:p,adminCss:w,addSectionConfig:d,addableSectionTypes:f,webMcp:e.webmcp,saveToFile:h.saveToFile,hotSave:h.hotSave,showLegacySave:h.showLegacySave,showHotSave:h.showHotSave})}),c.jsx(Je.Route,{path:"/admin/preview",element:c.jsx(Ic,{tenantCss:p,adminCss:w})}),c.jsx(Je.Route,{path:"/admin/preview/*",element:c.jsx(Ic,{tenantCss:p,adminCss:w})}),c.jsx(Je.Route,{path:"*",element:c.jsx(u,{})})]})})})}):c.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#0f172a",color:"#94a3b8",fontFamily:"ui-sans-serif, system-ui, sans-serif",fontSize:14},children:"Loading..."})}ae.AddSectionLibrary=wc,ae.AdminSidebar=mc,ae.ConfigProvider=Zi,ae.DefaultNotFound=yc,ae.FormFactory=Ir,ae.InputWidgets=ir,ae.JsonPagesEngine=C0,ae.PageRenderer=uo,ae.PreviewEntry=xc,ae.STUDIO_EVENTS=ve,ae.SectionRenderer=hr,ae.StudioProvider=Xr,ae.StudioStage=gc,ae.ThemeLoader=on,ae.applyValueAtSelectionPath=yi,ae.buildWebMcpToolName=wi,ae.cn=oe,ae.createWebMcpToolInputSchema=Ec,ae.ensureWebMcpRuntime=Si,ae.parseWebMcpToolName=Cc,ae.registerWebMcpTool=Nc,ae.resolveAssetUrl=Ul,ae.resolveHeaderMenuItems=rn,ae.resolveRuntimeConfig=It,ae.resolveSectionMenuItems=nn,ae.resolveWebMcpMutationData=ki,ae.shouldRenderSiteGlobalHeader=Ti,ae.themeManager=Qn,ae.useConfig=pr,ae.useStudio=es,Object.defineProperty(ae,Symbol.toStringTag,{value:"Module"})}));