ranui 0.2.1-alpha.4 → 0.3.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{button-Cj-XSCsd.js → button-Dw6YKyNd.js} +8 -8
- package/dist/button.js +1 -1
- package/dist/{colorpicker-mebH0XLm.js → colorpicker-CKA4xN-g.js} +2 -2
- package/dist/colorpicker.js +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/input/index.d.ts +15 -0
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/player.iife.js +1 -1
- package/dist/iife/select.iife.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.iife.js +2 -2
- package/dist/index.js +5 -5
- package/dist/{input-BlwAXu7I.js → input-ZY2Wumze.js} +9 -0
- package/dist/input.js +1 -1
- package/dist/{player-CAQ5Og2P.js → player-BkkmkqR4.js} +1 -1
- package/dist/player.js +1 -1
- package/dist/ranui.css +1 -1
- package/dist/{select-BIFVbQIj.js → select-DRKYa3W2.js} +1 -1
- package/dist/select.js +1 -1
- package/docs/COMPONENTS.md +43 -7
- package/docs/DESIGN.md +21 -22
- package/docs/style-tokens-public.md +89 -23
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fs=require("./rolldown-runtime-CAnuVJ4g.cjs");var hi="ran-theme",kr=null,Ir=null,pi=r=>{if(r&&"style"in r)return r;if(r&&"documentElement"in r)return r.documentElement;if(!(typeof document>"u"))return document.documentElement},_o=r=>{const c=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;r.setAttribute("data-ran-theme",c?"dark":"light"),r.setAttribute("theme",c?"dark":"light")},xd=()=>{kr&&Ir&&(kr.removeEventListener("change",Ir),kr=null,Ir=null)},Va=(r,c)=>{const g=pi(c);if(g){if(xd(),r==="system"){if(typeof window>"u")return;_o(g),kr=window.matchMedia("(prefers-color-scheme: dark)"),Ir=()=>_o(g),kr.addEventListener("change",Ir);try{localStorage.setItem(hi,"system")}catch{}return}g.setAttribute("data-ran-theme",r),g.setAttribute("theme",r);try{localStorage.setItem(hi,r)}catch{}}},ps=r=>{const c=pi(r);if(!c)return"";const g=c.getAttribute("data-ran-theme")||c.getAttribute("theme")||"";if(g==="light"||g==="dark"){try{if(localStorage.getItem(hi)==="system")return"system"}catch{}return g}return""},As=(r,c,g)=>{const A=pi(g);A&&A.style.setProperty(r,String(c))},ms=(r,c)=>{const g=pi(c);g&&g.style.removeProperty(r)},Td=(r,c)=>{Object.entries(r).forEach(([g,A])=>{if(A==null){ms(g,c);return}As(g,A,c)})},Dd=r=>{if(!(typeof localStorage>"u"))try{const c=localStorage.getItem(hi);(c==="light"||c==="dark"||c==="system")&&Va(c,r)}catch{}},vs=class{_events=new Map;tap=(r,c)=>{this._events.get(r)&&r!==Symbol.for("NEW_LISTENER")&&this.call(Symbol.for("NEW_LISTENER"),r);const g=this._events.get(r)||new Set;return typeof c=="function"?g.add({name:r,callback:c}):g.add(c),this._events.set(r,g),this};call=(r,...c)=>((this._events.get(r)||new Set).forEach(g=>{const{callback:A}=g;A(...c)}),this);callSync=async(r,...c)=>{const g=this._events.get(r)||new Set;for(const A of g){const{callback:k}=A;await k(...c)}return this};once=(r,c)=>{let g;if(typeof c=="function")g={name:r,callback:(...A)=>{c(...A),this.off(r,g)},initialCallback:c};else{const{callback:A}=c;g={name:r,callback:(...k)=>{A(...k),this.off(r,g)},initialCallback:A}}return this.tap(r,g),this};off=(r,c)=>{const g=[...this._events.get(r)||new Set].filter(A=>{if(typeof c=="function")return A.callback!==c&&A.initialCallback!==c;{const{callback:k}=c;return A.callback!==k&&A.initialCallback!==k}});return this._events.set(r,new Set(g)),this}},Qa=(r=8)=>Math.random().toString(36).substring(2,r+2),Wo=(r="")=>{if(r.length===0)return 0;if(r.endsWith("%")){const c=Number(r.replace("%",""));return c>1?c/100:c}return Number(r)},Gt=(r,c=0,g=1)=>Math.min(g,Math.max(c,r)),Rd=r=>typeof r=="function";function si(r){return r<10?`0${r}`:r}var Je=r=>{if(r===0)return"00:00";if(!r)return"";const c=Math.trunc(r/3600),g=Math.trunc(r%3600/60),A=si(Math.trunc(r-3600*c-60*g));return c===0?`${si(g)}:${A}`:`${si(c)}:${si(g)}:${A}`},Xo=()=>{if(typeof window<"u"){const r=navigator.userAgent.toLowerCase();return/ipad|ipod/.test(r)?"ipad":/android/.test(r)?"android":/iphone/.test(r)?"iphone":"pc"}return"pc"},bs=typeof window<"u",Br=()=>{if(!bs)return!1;const r=window.navigator.userAgent;return!!/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(r)},vr=r=>{const c=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||1;return(bs&&window.devicePixelRatio||1)/c},Md=12e4,Fd="__ranuts_bridge__",Od="default",Zo=new class{bridges=new Set;attachedWindow=null;handleMessage=r=>{for(const c of Array.from(this.bridges))c.receive(r)};add(r){this.bridges.add(r),typeof window<"u"&&this.attachedWindow!==window&&(window.addEventListener("message",this.handleMessage),this.attachedWindow=window)}remove(r){this.bridges.delete(r),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener("message",this.handleMessage),this.attachedWindow=null)}},Pd=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(r,c="*",g=Od){this.targetOrigin=c,this.channel=g,this.senderId=Qa(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<"u",this.available?(this.targetWindow=r??window,Zo.add(this)):this.targetWindow=void 0}post(r,c){const g={...c,__bridge:Fd,channel:this.channel,senderId:this.senderId};r.postMessage(g,this.targetOrigin)}receive=r=>{if(!this.available||this.targetOrigin!=="*"&&r.origin!==this.targetOrigin||r.source&&r.source!==this.targetWindow)return;const c=r.data;if(!c||typeof c!="object"||c.__bridge!=="__ranuts_bridge__"||(c.channel??"default")!==this.channel)return;const{type:g,payload:A,id:k,isResponse:B,isError:D,senderId:O}=c;if(B&&k){const X=this.pendingRequests.get(k);X&&(D?X.reject(new Error(typeof A=="string"?A:"Bridge request failed")):X.resolve(A),this.pendingRequests.delete(k));return}if(O&&O===this.senderId||typeof g!="string"||!this.messageHandlers.has(g))return;const Y=this.messageHandlers.get(g);if(Rd(Y)){const X=r.source??this.targetWindow;Promise.resolve(Y(A)).then(wt=>{k&&this.post(X,{type:g,payload:wt,id:k,isResponse:!0})}).catch(wt=>{k&&this.post(X,{type:g,payload:wt instanceof Error?wt.message:String(wt),id:k,isResponse:!0,isError:!0})})}};on=(r,c)=>{this.messageHandlers.set(r,c)};off=r=>{this.messageHandlers.delete(r)};send=async(r,c)=>{if(!this.available)return Promise.reject(new Error("PostMessageBridge is unavailable outside a browser environment"));const g=Qa(10);return new Promise((A,k)=>{const B=setTimeout(()=>{this.pendingRequests.has(g)&&(this.pendingRequests.delete(g),k(new Error("Request timeout")))},Md),D=O=>{clearTimeout(B),k(O)};this.pendingRequests.set(g,{resolve:O=>{clearTimeout(B),A(O)},reject:D});try{this.post(this.targetWindow,{type:r,payload:c,id:g})}catch(O){this.pendingRequests.delete(g),D(O instanceof Error?O:new Error("Failed to post message"))}})};broadcast=r=>{if(this.available)try{this.post(this.targetWindow,{type:r.type,payload:r.payload})}catch{}};destroy=()=>{Zo.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(r=>{r.reject(new Error("Bridge destroyed"))}),this.pendingRequests.clear()}},Ud=class Cr{static instance;bridges=new Map;constructor(){}static getInstance(){return Cr.instance||(Cr.instance=new Cr),Cr.instance}connectClient=({id:c,targetOrigin:g,targetWindow:A,channel:k})=>{const B=new Pd(A,g,k);if(c||(c=Qa(10)),this.bridges.has(c))throw new Error(`Bridge ${c} already exists`);return this.bridges.set(c,B),{bridge:B,id:c}};getClient=c=>this.bridges.get(c);removeClient=c=>{const g=this.bridges.get(c);g&&(g.destroy(),this.bridges.delete(c))};removeAllClient=()=>{this.bridges.forEach(c=>{c.destroy()}),this.bridges.clear()};broadcast=c=>{this.bridges.forEach(g=>{g.broadcast(c)})};sendTo=(c,g,A)=>{const k=this.getClient(c);return k?k.send(g,A):Promise.reject(new Error(`Bridge ${c} not found`))}},zg=Ud.getInstance(),Vg=new vs,z=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],N=class{highOrder;lowOrder;constructor(r,c){this.highOrder=r,this.lowOrder=c}},qg=[new N(z[0],3609767458),new N(z[1],602891725),new N(z[2],3964484399),new N(z[3],2173295548),new N(z[4],4081628472),new N(z[5],3053834265),new N(z[6],2937671579),new N(z[7],3664609560),new N(z[8],2734883394),new N(z[9],1164996542),new N(z[10],1323610764),new N(z[11],3590304994),new N(z[12],4068182383),new N(z[13],991336113),new N(z[14],633803317),new N(z[15],3479774868),new N(z[16],2666613458),new N(z[17],944711139),new N(z[18],2341262773),new N(z[19],2007800933),new N(z[20],1495990901),new N(z[21],1856431235),new N(z[22],3175218132),new N(z[23],2198950837),new N(z[24],3999719339),new N(z[25],766784016),new N(z[26],2566594879),new N(z[27],3203337956),new N(z[28],1034457026),new N(z[29],2466948901),new N(z[30],3758326383),new N(z[31],168717936),new N(z[32],1188179964),new N(z[33],1546045734),new N(z[34],1522805485),new N(z[35],2643833823),new N(z[36],2343527390),new N(z[37],1014477480),new N(z[38],1206759142),new N(z[39],344077627),new N(z[40],1290863460),new N(z[41],3158454273),new N(z[42],3505952657),new N(z[43],106217008),new N(z[44],3606008344),new N(z[45],1432725776),new N(z[46],1467031594),new N(z[47],851169720),new N(z[48],3100823752),new N(z[49],1363258195),new N(z[50],3750685593),new N(z[51],3785050280),new N(z[52],3318307427),new N(z[53],3812723403),new N(z[54],2003034995),new N(z[55],3602036899),new N(z[56],1575990012),new N(z[57],1125592928),new N(z[58],2716904306),new N(z[59],442776044),new N(z[60],593698344),new N(z[61],3733110249),new N(z[62],2999351573),new N(z[63],3815920427),new N(3391569614,3928383900),new N(3515267271,566280711),new N(3940187606,3454069534),new N(4118630271,4000239992),new N(116418474,1914138554),new N(174292421,2731055270),new N(289380356,3203993006),new N(460393269,320620315),new N(685471733,587496836),new N(852142971,1086792851),new N(1017036298,365543100),new N(1126000580,2618297676),new N(1288033470,3409855158),new N(1501505948,4234509866),new N(1607167915,987167468),new N(1816402316,1246189591)],_g=[new N(0,1),new N(0,32898),new N(2147483648,32906),new N(2147483648,2147516416),new N(0,32907),new N(0,2147483649),new N(2147483648,2147516545),new N(2147483648,32777),new N(0,138),new N(0,136),new N(0,2147516425),new N(0,2147483658),new N(0,2147516555),new N(2147483648,139),new N(2147483648,32905),new N(2147483648,32771),new N(2147483648,32770),new N(2147483648,128),new N(0,32778),new N(2147483648,2147483658),new N(2147483648,2147516545),new N(2147483648,32896),new N(0,2147483649),new N(2147483648,2147516424)],br=(r,c=500)=>{let g;return(...A)=>{clearTimeout(g),g=setTimeout(()=>{r.apply(void 0,A)},c)}},de=(r,c)=>{if(typeof document>"u")return;const g=r.classList;g.contains(c)||g.add(c)},be=(r,c)=>{if(typeof document>"u")return;const g=r.classList;g.contains(c)&&g.remove(c)},ys=()=>{let r=0,c=null;return function(g,A=300){return function(...k){const B=Date.now();B-r>=A?(c!=null&&(clearTimeout(c),c=null),r=B,g.apply(this,k)):c??=window.setTimeout(()=>{r=Date.now(),g.apply(this,k),c=null},A-(B-r))}}},Ia=new Map([[100,"Continue"],[101,"Switching Protocols"],[102,"Processing"],[103,"Early Hints"],[200,"OK"],[201,"Created"],[202,"Accepted"],[203,"Non-Authoritative Information"],[204,"No Content"],[205,"Reset Content"],[206,"Partial Content"],[207,"Multi-Status"],[208,"Already Reported"],[226,"IM Used"],[300,"Multiple Choices"],[301,"Moved Permanently"],[302,"Found"],[303,"See Other"],[304,"Not Modified"],[305,"Use Proxy"],[307,"Temporary Redirect"],[308,"Permanent Redirect"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Timeout"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Payload Too Large"],[414,"URI Too Long"],[415,"Unsupported Media Type"],[416,"Range Not Satisfiable"],[417,"Expectation Failed"],[418,"I'm a Teapot"],[421,"Misdirected Request"],[422,"Unprocessable Entity"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Timeout"],[505,"HTTP Version Not Supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[508,"Loop Detected"],[509,"Bandwidth Limit Exceeded"],[510,"Not Extended"],[511,"Network Authentication Required"]]),Wg={message:Ia,code:(function(r){const c=new Map;for(const[g,A]of r)c.set(A.toLowerCase(),g);return c})(Ia),codes:(function(r){const c=[];for(const[g,A]of r)c.push(g);return c})(Ia),redirect:{300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},empty:{204:!0,205:!0,304:!0},retry:{502:!0,503:!0,504:!0}},Qd='.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{box-sizing:var(--ran-btn-box-sizing, border-box);position:var(--ran-btn-position, relative);display:var(--ran-btn-display, inline-flex);background-image:var(--ran-btn-background-image, none);box-shadow:var(--ran-btn-box-shadow, var(--ran-skin-raised-shadow, 0 2px #00000004));cursor:var(--ran-btn-cursor, pointer);-webkit-user-select:var(--ran-btn-user-select, none);user-select:var(--ran-btn-user-select, none);touch-action:var(--ran-btn-touch-action, manipulation);overflow:var(--ran-btn-overflow, hidden);pointer-events:var(--ran-btn-pointer-events, auto)}:host .ran-btn{box-sizing:var(--ran-btn-contain-box-sizing, border-box);position:var(--ran-btn-contain-position, relative);display:var(--ran-btn-contain-display, block);background-image:var(--ran-btn-contain-background-image, none);cursor:var(--ran-btn-contain-cursor, pointer);transition:var(--ran-btn-contain-transition, opacity var(--ran-motion-duration-base, .2s) var(--ran-motion-ease-standard, cubic-bezier(.645, .045, .355, 1)));-webkit-user-select:var(--ran-btn-contain-user-select, none);user-select:var(--ran-btn-contain-user-select, none);touch-action:var(--ran-btn-contain-touch-action, manipulation);border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));background:var(--ran-btn-contain-background, var(--ran-color-bg-elevated, #fff))}:host,:host(:active),:host(:focus){outline:0;-webkit-tap-highlight-color:transparent}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:var(--ran-btn-contain-outline, 0)}:host(:focus-visible){outline:var(--ran-btn-focus-outline, 2px solid var(--ran-color-primary));outline-offset:var(--ran-btn-focus-outline-offset, 2px)}:host([type="primary"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-primary, #006bff));background-image:var(--ran-btn-content-background-image, none);border-color:var(--ran-btn-content-border-color, var(--ran-color-primary, #006bff));color:var(--ran-btn-content-color, #fff)}:host([type="primary"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="primary"]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color, var(--ran-color-primary-active, #005ff2));border-color:var(--ran-btn-content-active-border-color, var(--ran-color-primary-active, #005ff2))}:host([type="contrast"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-contrast-bg, #171717));background-image:var(--ran-btn-content-background-image, none);border-color:var(--ran-btn-content-border-color, var(--ran-color-contrast-bg, #171717));color:var(--ran-btn-content-color, var(--ran-color-contrast-text, #fff))}:host([type="contrast"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, var(--ran-color-contrast-text, #fff) 10%, transparent 10.01%))}:host([type="contrast"]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color, var(--ran-color-contrast-bg-active, #4d4d4d));border-color:var(--ran-btn-content-active-border-color, var(--ran-color-contrast-bg-active, #4d4d4d))}@media(min-width:1024px){:host(:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-border-hover, #c9c9c9));color:var(--ran-btn-content-hover-color, var(--ran-color-text, #171717))}:host([type="primary"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, var(--ran-color-primary-hover, #0059ec));border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-primary-hover, #0059ec));color:var(--ran-btn-content-hover-color, #fff)}:host([type="contrast"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, var(--ran-color-contrast-bg-hover, #383838));border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-contrast-bg-hover, #383838));color:var(--ran-btn-content-hover-color, var(--ran-color-contrast-text, #fff))}:host([type="warning"]:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));color:var(--ran-btn-content-warning-color, #fff)}}:host([type="warning"]) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));background-image:var(--ran-btn-content-background-image, none);color:var(--ran-btn-content-warning-color, #fff)}:host([type="warning"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="text"]) .ran-btn-content{border:var(--ran-btn-content-text-border, none)}:host([disabled]){cursor:var(--ran-btn-disabled-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-pointer-events, all);opacity:var(--ran-btn-disabled-opacity, .6)}:host([disabled]) .ran-btn{cursor:var(--ran-btn-disabled-container-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-container-pointer-events, all);opacity:var(--ran-btn-disabled-container-opacity, .6)}:host(:not([disabled]):active) .ran-btn:after{transform:var(--ran-btn-after-transform, translate(-50%, -50%) scale(0));opacity:var(--ran-btn-after-opacity, .3);transition:var(--ran-btn-after-transition, 0s)}:host(:not([disabled]):active) .ran-btn-content{transform:var(--ran-btn-content-active-transform, scale(.96))}@media(min-width:1024px){:host(:not([disabled],[effect])) .ran-btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--ran-x, 0);top:var(--ran-y, 0);pointer-events:none;background-image:radial-gradient(circle,var(--ran-gray-alpha-400, #00000014) 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}}:host .slot{display:var(--ran-btn-slot-display, block)}.ran-btn-content{display:var(--ran-btn-content-display, flex);justify-content:var(--ran-btn-content-display, space-between);align-items:var(--ran-btn-content-align-items, center);padding:var(--ran-btn-content-padding, 4px 15px);border:var(--ran-btn-content-border, 1px solid transparent);border-image-source:var(--ran-btn-content-border-image-source, none);border-image-slice:var(--ran-btn-content-border-image-slice, 8);border-image-width:var(--ran-btn-content-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));border-color:var(--ran-btn-content-border-color, var(--ran-color-border, #eaeaea));color:var(--ran-btn-content-color, var(--ran-color-text, #000000d9));line-height:var(--ran-btn-content-line-height, 22px);font-size:var(--ran-btn-content-font-size, 14px);font-weight:var(--ran-btn-content-font-weight, 400);font-family:var(--ran-btn-content-font-family, var(--ran-skin-font-family, inherit));white-space:var(--ran-btn-content-white-space, nowrap);text-align:var(--ran-btn-content-text-align, center);box-sizing:var(--ran-btn-content-box-sizing, border-box);transition:var(--ran-btn-content-transition, transform var(--ran-motion-duration-base, .2s) var(--ran-motion-ease-spring, cubic-bezier(.34, 1.26, .5, 1)))}.ran-btn-content .icon{margin-right:var(--ran-btn-icon-margin-right, 2px)}@media(prefers-reduced-motion:reduce){.ran-btn-content{transition:none}}',zt=typeof document>"u",xt=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(r,c,g,A){return r.addEventListener(c,g,{...A,signal:this.ac.signal}),this}delegate(r,c,g,A,k){return r.addEventListener(g,B=>{const D=B.target?.closest(c);D&&r.contains(D)&&A(B,D)},{...k,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}},ui=0,ws=1,Ai=2,ye=null,jt=null,Cs=0,di=new Set,Ba=!1;function qa(r,c){const g=c?.equals??Object.is,A={value:r,observers:new Set};return[()=>(Kd(A),A.value),D=>{const O=typeof D=="function"?D(A.value):D;if(!g(A.value,O)){A.value=O;for(const Y of A.observers)_a(Y,Ai);Cs===0&&Yd()}}]}function Ee(r){const c=Nd(r,!0);return Hd(c),ks(c),()=>Wa(c)}function mi(r){const c={owned:[],cleanups:[],owner:jt},g=jt,A=ye;jt=c,ye=null;try{return r(()=>Gd(c))}finally{jt=g,ye=A}}function vi(r){jt&&jt.cleanups.push(r)}function Nd(r,c,g){return{fn:r,sources:new Set,isEffect:c,running:!1,disposed:!1,state:Ai,observers:new Set,value:void 0,equals:g??Object.is,owned:[],cleanups:[],owner:jt}}function Hd(r){jt&&jt.owned.push(r)}function Kd(r){ye&&(ye.sources.add(r),r.observers.add(ye))}function _a(r,c){if(r.disposed||r.state>=c)return;const g=r.state===ui;if(r.state=c,r.isEffect)di.add(r);else if(g)for(const A of r.observers)_a(A,ws)}function Yd(){if(!(Cs>0||Ba)){Ba=!0;try{for(;di.size>0;){const r=[...di];di.clear();for(const c of r)c.disposed||Es(c)}}finally{Ba=!1}}}function Es(r){if(!(r.disposed||r.state===ui)){if(r.state===ws)for(const c of r.sources)"fn"in c&&Es(c);r.state===Ai&&ks(r),r.state=ui}}function ks(r){if(r.running)throw new Error("ranui reactivity: cyclic dependency detected (a computation triggered itself).");Is(r);const c=ye,g=jt;ye=r,jt=r,r.running=!0,r.state=ui;try{const A=r.fn();if(r.isEffect)typeof A=="function"&&r.cleanups.push(A);else{const k=r.value;if(r.value=A,r.observers.size>0&&!r.equals(k,A))for(const B of r.observers)_a(B,Ai)}}finally{r.running=!1,ye=c,jt=g}}function Is(r){for(const c of r.owned)Wa(c);r.owned.length=0;for(const c of r.cleanups)c();r.cleanups.length=0;for(const c of r.sources)c.observers.delete(r);r.sources.clear()}function Wa(r){r.disposed||(r.disposed=!0,Is(r),r.observers.clear())}function Gd(r){for(const c of r.owned)Wa(c);r.owned.length=0;for(const c of r.cleanups)c();r.cleanups.length=0}function je(r){return typeof r!="string"?String(r):r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Jo(r){return je(r)}var zd=r=>typeof r=="string"?!1:"tagName"in r&&"childrenList"in r,Vd=(r,c)=>{const g=c.trim();if(!g)return!1;if(g.startsWith("."))return r.classList.contains(g.slice(1));if(g.startsWith("#"))return r.getAttribute("id")===g.slice(1);if(g.startsWith("[")&&g.endsWith("]")){const[A,k]=g.slice(1,-1).trim().split("="),B=(A||"").trim();if(!B)return!1;if(k==null)return r.hasAttribute(B);const D=k.trim().replace(/^['"]|['"]$/g,"");return r.getAttribute(B)===D}return r.tagName===g.toLowerCase()},bi=(r,c,g)=>{for(const A of r)zd(A)&&(Vd(A,c)&&g.push(A),bi(A.childrenList,c,g))},Na=class{childrenList=[];appendChild(r){return this.childrenList.push(r),r}serialize(){return this.childrenList.map(r=>typeof r=="string"?je(r):r.serialize()).join("")}querySelector(r){const c=this.querySelectorAll(r);return c.length>0?c[0]:null}querySelectorAll(r){const c=[];return bi(this.childrenList,r,c),c}},Xa=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(r,c)=>{const g=r.startsWith("--")?r:r.replace(/([A-Z])/g,"-$1").toLowerCase();this.inlineStyles.set(g,c)},removeProperty:r=>this.inlineStyles.delete(r)};classList={add:(...r)=>{const c=this.attributes.get("class")||"",g=new Set([...c.split(" ").filter(Boolean),...r]);this.attributes.set("class",Array.from(g).join(" "))},remove:(...r)=>{const c=(this.attributes.get("class")||"").split(" ").filter(g=>!r.includes(g));this.attributes.set("class",c.join(" "))},toggle:r=>{this.classList.contains(r)?this.classList.remove(r):this.classList.add(r)},contains:r=>(this.attributes.get("class")||"").split(" ").includes(r)};_innerHTML="";get innerHTML(){return this._innerHTML}set innerHTML(r){this._innerHTML=r,this.tagName==="template"&&this.content&&(this.content.childrenList=[r])}constructor(r="div"){this.tagName=r.toLowerCase(),this.tagName==="template"&&(this.content=new Na)}get hidden(){return this.hasAttribute("hidden")}set hidden(r){r?this.setAttribute("hidden",""):this.removeAttribute("hidden")}setAttribute(r,c){this.attributes.set(r,c)}getAttribute(r){return this.attributes.get(r)||null}removeAttribute(r){this.attributes.delete(r)}hasAttribute(r){return this.attributes.has(r)}appendChild(r){return this.childrenList.push(r),r}attachShadow(r){return this.shadowRoot=new qd(this,r),this.shadowRoot}querySelector(r){const c=this.querySelectorAll(r);return c.length>0?c[0]:null}querySelectorAll(r){const c=[];return bi(this.childrenList,r,c),c}addEventListener(r,c){const g=this.eventListeners.get(r)||new Set;g.add(c),this.eventListeners.set(r,g)}removeEventListener(r,c){const g=this.eventListeners.get(r);g&&(g.delete(c),g.size===0&&this.eventListeners.delete(r))}dispatchEvent(r){const c=this.eventListeners.get(r.type);if(!c||c.size===0)return!0;for(const g of c)typeof g=="function"?g.call(this,r):g.handleEvent(r);return!r.defaultPrevented}serialize(r){typeof this._preSerialize=="function"&&this._preSerialize();const c=r||this._ssrTag||this.tagName,g=Array.from(this.attributes.entries()).map(([D,O])=>` ${D}="${Jo(O)}"`).join(""),A=Array.from(this.inlineStyles.entries()).map(([D,O])=>`${D}:${O}`).join(";"),k=A?` style="${Jo(A)}"`:"";let B="";return this.shadowRoot&&(B+=this.shadowRoot.serialize()),this.textContent!==null?B+=je(this.textContent):this._innerHTML?B+=this._innerHTML:B+=this.childrenList.map(D=>typeof D=="string"?je(D):(D instanceof Na,D.serialize())).join(""),["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"].includes(c)&&!B?`<${c}${g}${k} />`:`<${c}${g}${k}>${B}</${c}>`}},qd=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(r,c){this.host=r,this.options=c}appendChild(r){return this.childrenList.push(r),r}querySelector(r){const c=this.querySelectorAll(r);return c.length>0?c[0]:null}querySelectorAll(r){const c=[];return bi(this.childrenList,r,c),c}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?" shadowrootdelegatesfocus":""}>${this.adoptedStyleSheets.map(r=>`<style>${je(r)}</style>`).join("")}${this.childrenList.map(r=>typeof r=="string"?je(r):(r instanceof Na,r.serialize())).join("")}</template>`}},Bs=r=>r.reduce((c,g)=>Array.isArray(g)?c.concat(Bs(g)):c.concat(g),[]),Sr=r=>r==null?null:r instanceof Ss?r.build():typeof r=="string"?zt?r:document.createTextNode(r):r,_d=(r,c)=>{if(zt){gi(r,[c()]);return}const g=document.createComment(""),A=document.createComment("");r.appendChild(g),r.appendChild(A);let k=null;const B=()=>{k?.(),k=null;let D=g.nextSibling;for(;D&&D!==A;){const O=D.nextSibling;D.parentNode?.removeChild(D),D=O}};Ee(()=>{const D=c();B();const O=document.createDocumentFragment();k=mi(Y=>(gi(O,[D]),Y)),A.parentNode?.insertBefore(O,A)}),vi(()=>k?.())},Wd="__ranFor",Xd=r=>typeof r=="object"&&r!==null&&r[Wd]===!0,Zd=(r,c,g)=>{const[A,k]=qa(c);let B=null;const D=mi(O=>{const Y=Sr(g(r,A));return B=typeof Y=="string"?document.createTextNode(Y):Y,O});return{node:B,index:k,dispose:D}},Ls=(r,c)=>{const g=r.parentNode;if(!g)return;let A=r;for(const k of c)A.nextSibling!==k&&g.insertBefore(k,A.nextSibling),A=k},Jd=(r,c)=>{if(zt){(c.each()??[]).forEach((k,B)=>{const D=Sr(c.render(k,()=>B));D!=null&&r.appendChild(D)});return}const g=document.createComment("");r.appendChild(g);let A=new Map;vi(()=>{for(const k of A.values())k.dispose();A.clear()}),Ee(()=>{const k=c.each()??[],B=new Map,D=[];k.forEach((O,Y)=>{const X=c.key(O,Y);if(B.has(X))return;let wt=A.get(X);wt?(A.delete(X),wt.index(Y)):wt=Zd(O,Y,c.render),B.set(X,wt),wt.node&&D.push(wt.node)});for(const O of A.values())O.node?.parentNode?.removeChild(O.node),O.dispose();Ls(g,D),A=B})},jd="__ranIndex",$d=r=>typeof r=="object"&&r!==null&&r[jd]===!0,th=(r,c,g)=>{const[A,k]=qa(r);let B=null;const D=mi(O=>{const Y=Sr(g(A,c));return B=typeof Y=="string"?document.createTextNode(Y):Y,O});return{node:B,setItem:k,dispose:D}},eh=(r,c)=>{if(zt){(c.each()??[]).forEach((k,B)=>{const D=Sr(c.render(()=>k,B));D!=null&&r.appendChild(D)});return}const g=document.createComment("");r.appendChild(g);let A=[];vi(()=>{for(const k of A)k.dispose();A=[]}),Ee(()=>{const k=c.each()??[];for(let B=0;B<k.length;B++)B<A.length?A[B].setItem(k[B]):A.push(th(k[B],B,c.render));for(let B=A.length-1;B>=k.length;B--){const{node:D}=A[B];D?.parentNode?.removeChild(D),A[B].dispose(),A.pop()}Ls(g,A.map(B=>B.node).filter(B=>B!=null))})},gi=(r,c)=>{Bs(c).forEach(g=>{if(Xd(g)){Jd(r,g);return}if($d(g)){eh(r,g);return}if(typeof g=="function"){_d(r,g);return}const A=Sr(g);A!=null&&r.appendChild(A)})},Ss=class{el;constructor(r){this.el=zt?new Xa(r):document.createElement(r)}id(r){return this.el.setAttribute("id",r),this}bind(r,c){typeof r=="function"?Ee(()=>c(r())):c(r)}class(r){return this.bind(r,c=>{zt?this.el.attributes.set("class",c):this.el.className=c}),this}addClass(...r){return r.forEach(c=>this.el.classList.add(c)),this}removeClass(...r){return r.forEach(c=>this.el.classList.remove(c)),this}attr(r,c){return this.bind(c,g=>this.el.setAttribute(r,g)),this}attrs(r){return Object.entries(r).forEach(([c,g])=>{g!=null&&this.el.setAttribute(c,String(g))}),this}boolAttr(r,c,g=""){return this.bind(c,A=>{A?this.el.setAttribute(r,g):this.el.removeAttribute(r)}),this}part(r){return this.attr("part",r)}data(r,c){return this.attr(`data-${r}`,c)}style(r,c){return typeof r=="string"?this.bind(c??"",g=>this.el.style.setProperty(r,g)):Object.entries(r).forEach(([g,A])=>this.el.style.setProperty(g,A)),this}cssVar(r,c){const g=r.startsWith("--")?r:`--${r}`;return this.style(g,c)}aria(r,c){return this.attr(`aria-${r}`,c)}role(r){return this.attr("role",r)}tabIndex(r){return this.attr("tabindex",String(r))}label(r){return this.aria("label",r)}labelledBy(r){return this.aria("labelledby",r)}describedBy(r){return this.aria("describedby",r)}ariaHidden(r=!0){return this.aria("hidden",String(r))}on(r,c,g){return this.el.addEventListener(r,c,g),this}listen(r,c,g,A){return r.on(this.el,c,g,A),this}delegate(r,c,g,A,k){return r.delegate(this.el,c,g,A,k),this}children(...r){return gi(this.el,r),this}replaceChildren(...r){if(zt){const c=this.el;c.childrenList=[]}else this.el.replaceChildren();return this.children(...r)}text(r){return this.bind(r,c=>{this.el.textContent=c}),this}ref(r){return r.current=this.el,this}shadow(r={mode:"closed"}){const c=this.el.attachShadow(r);return new rh(this.el,c,r)}build(){return this.el}serialize(){if(zt)return this.el.serialize();const r=document.createElement("div");return r.appendChild(this.el.cloneNode(!0)),r.innerHTML}},rh=class{root;hostEl;options;constructor(r,c,g){this.hostEl=r,this.root=c,this.options=g}children(...r){return gi(this.root,r),this}adoptSheet(...r){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...r],this}css(r){if(zt)return this.root.adoptedStyleSheets.push(r),this;if(typeof CSSStyleSheet<"u")try{const g=new CSSStyleSheet;return g.replaceSync(r),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,g],this}catch{}const c=document.createElement("style");return c.textContent=r,this.root.appendChild(c),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return zt?this.root.serialize():this.root.innerHTML}},rt=r=>new Ss(r),x=()=>rt("div"),ke=()=>rt("span"),Bt=()=>rt("slot"),Ha=()=>rt("button"),Za=()=>rt("input"),ih=()=>rt("style"),ah=()=>rt("label"),ce=[!1,"false",null,void 0],yt=r=>{const c=r.hasAttribute("disabled"),g=r.getAttribute("disabled");return!!(c&&!ce.includes(g))},xs=new Map;function dt(r,c){zt?(xs.set(r,c),c.prototype._ssrTag=r):customElements.get(r)||customElements.define(r,c)}function nh(){return xs}var Ts=()=>typeof document<"u"?HTMLElement:Xa,ct=Ts(),oh=r=>{if(r.tagName&&r.tagName!=="div")return r.tagName;const c=nh();for(const[g,A]of c)if(r instanceof A)return g;return r.constructor.name.toLowerCase()},sh=r=>{if(!r)return"";const c=oh(r);return typeof r.serialize=="function"||r instanceof Xa?r.serialize(c):""},La=new Map,Sa=new Map,lh=(r,c)=>{if(!(typeof document>"u")&&c){if(typeof CSSStyleSheet<"u")try{if(!La.has(c)){const A=new CSSStyleSheet;A.replaceSync(c),La.set(c,A)}const g=La.get(c);r.adoptedStyleSheets.includes(g)||(r.adoptedStyleSheets=[...r.adoptedStyleSheets,g]);return}catch{}if(!r.querySelector("style[data-ranui]")){const g=document.createElement("style");g.setAttribute("data-ranui",""),g.textContent=c,r.appendChild(g)}}},ch=(r,c)=>{if(!(typeof document>"u")&&c){if(typeof CSSStyleSheet<"u")try{if(!Sa.has(c)){const A=new CSSStyleSheet;A.replaceSync(c),Sa.set(c,A)}const g=Sa.get(c);r.adoptedStyleSheets.includes(g)||(r.adoptedStyleSheets=[...r.adoptedStyleSheets,g]);return}catch{}if(!Array.from(r.querySelectorAll("style[data-ranui-sheet]")).some(g=>g.textContent===c)){const g=document.createElement("style");g.setAttribute("data-ranui-sheet",""),g.textContent=c,r.appendChild(g)}}},jo=new WeakMap,$o="@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}",ht=(r,c="",g={mode:"closed"})=>{const A=r.shadowRoot||jo.get(r)||r.attachShadow(g);return jo.set(r,A),lh(A,c?`${c}
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fs=require("./rolldown-runtime-CAnuVJ4g.cjs");var hi="ran-theme",kr=null,Ir=null,pi=r=>{if(r&&"style"in r)return r;if(r&&"documentElement"in r)return r.documentElement;if(!(typeof document>"u"))return document.documentElement},_o=r=>{const c=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;r.setAttribute("data-ran-theme",c?"dark":"light"),r.setAttribute("theme",c?"dark":"light")},xd=()=>{kr&&Ir&&(kr.removeEventListener("change",Ir),kr=null,Ir=null)},Va=(r,c)=>{const g=pi(c);if(g){if(xd(),r==="system"){if(typeof window>"u")return;_o(g),kr=window.matchMedia("(prefers-color-scheme: dark)"),Ir=()=>_o(g),kr.addEventListener("change",Ir);try{localStorage.setItem(hi,"system")}catch{}return}g.setAttribute("data-ran-theme",r),g.setAttribute("theme",r);try{localStorage.setItem(hi,r)}catch{}}},ps=r=>{const c=pi(r);if(!c)return"";const g=c.getAttribute("data-ran-theme")||c.getAttribute("theme")||"";if(g==="light"||g==="dark"){try{if(localStorage.getItem(hi)==="system")return"system"}catch{}return g}return""},As=(r,c,g)=>{const A=pi(g);A&&A.style.setProperty(r,String(c))},ms=(r,c)=>{const g=pi(c);g&&g.style.removeProperty(r)},Td=(r,c)=>{Object.entries(r).forEach(([g,A])=>{if(A==null){ms(g,c);return}As(g,A,c)})},Dd=r=>{if(!(typeof localStorage>"u"))try{const c=localStorage.getItem(hi);(c==="light"||c==="dark"||c==="system")&&Va(c,r)}catch{}},vs=class{_events=new Map;tap=(r,c)=>{this._events.get(r)&&r!==Symbol.for("NEW_LISTENER")&&this.call(Symbol.for("NEW_LISTENER"),r);const g=this._events.get(r)||new Set;return typeof c=="function"?g.add({name:r,callback:c}):g.add(c),this._events.set(r,g),this};call=(r,...c)=>((this._events.get(r)||new Set).forEach(g=>{const{callback:A}=g;A(...c)}),this);callSync=async(r,...c)=>{const g=this._events.get(r)||new Set;for(const A of g){const{callback:k}=A;await k(...c)}return this};once=(r,c)=>{let g;if(typeof c=="function")g={name:r,callback:(...A)=>{c(...A),this.off(r,g)},initialCallback:c};else{const{callback:A}=c;g={name:r,callback:(...k)=>{A(...k),this.off(r,g)},initialCallback:A}}return this.tap(r,g),this};off=(r,c)=>{const g=[...this._events.get(r)||new Set].filter(A=>{if(typeof c=="function")return A.callback!==c&&A.initialCallback!==c;{const{callback:k}=c;return A.callback!==k&&A.initialCallback!==k}});return this._events.set(r,new Set(g)),this}},Qa=(r=8)=>Math.random().toString(36).substring(2,r+2),Wo=(r="")=>{if(r.length===0)return 0;if(r.endsWith("%")){const c=Number(r.replace("%",""));return c>1?c/100:c}return Number(r)},Gt=(r,c=0,g=1)=>Math.min(g,Math.max(c,r)),Rd=r=>typeof r=="function";function si(r){return r<10?`0${r}`:r}var Je=r=>{if(r===0)return"00:00";if(!r)return"";const c=Math.trunc(r/3600),g=Math.trunc(r%3600/60),A=si(Math.trunc(r-3600*c-60*g));return c===0?`${si(g)}:${A}`:`${si(c)}:${si(g)}:${A}`},Xo=()=>{if(typeof window<"u"){const r=navigator.userAgent.toLowerCase();return/ipad|ipod/.test(r)?"ipad":/android/.test(r)?"android":/iphone/.test(r)?"iphone":"pc"}return"pc"},bs=typeof window<"u",Br=()=>{if(!bs)return!1;const r=window.navigator.userAgent;return!!/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(r)},vr=r=>{const c=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||1;return(bs&&window.devicePixelRatio||1)/c},Md=12e4,Fd="__ranuts_bridge__",Od="default",Zo=new class{bridges=new Set;attachedWindow=null;handleMessage=r=>{for(const c of Array.from(this.bridges))c.receive(r)};add(r){this.bridges.add(r),typeof window<"u"&&this.attachedWindow!==window&&(window.addEventListener("message",this.handleMessage),this.attachedWindow=window)}remove(r){this.bridges.delete(r),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener("message",this.handleMessage),this.attachedWindow=null)}},Pd=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(r,c="*",g=Od){this.targetOrigin=c,this.channel=g,this.senderId=Qa(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<"u",this.available?(this.targetWindow=r??window,Zo.add(this)):this.targetWindow=void 0}post(r,c){const g={...c,__bridge:Fd,channel:this.channel,senderId:this.senderId};r.postMessage(g,this.targetOrigin)}receive=r=>{if(!this.available||this.targetOrigin!=="*"&&r.origin!==this.targetOrigin||r.source&&r.source!==this.targetWindow)return;const c=r.data;if(!c||typeof c!="object"||c.__bridge!=="__ranuts_bridge__"||(c.channel??"default")!==this.channel)return;const{type:g,payload:A,id:k,isResponse:B,isError:D,senderId:O}=c;if(B&&k){const X=this.pendingRequests.get(k);X&&(D?X.reject(new Error(typeof A=="string"?A:"Bridge request failed")):X.resolve(A),this.pendingRequests.delete(k));return}if(O&&O===this.senderId||typeof g!="string"||!this.messageHandlers.has(g))return;const Y=this.messageHandlers.get(g);if(Rd(Y)){const X=r.source??this.targetWindow;Promise.resolve(Y(A)).then(wt=>{k&&this.post(X,{type:g,payload:wt,id:k,isResponse:!0})}).catch(wt=>{k&&this.post(X,{type:g,payload:wt instanceof Error?wt.message:String(wt),id:k,isResponse:!0,isError:!0})})}};on=(r,c)=>{this.messageHandlers.set(r,c)};off=r=>{this.messageHandlers.delete(r)};send=async(r,c)=>{if(!this.available)return Promise.reject(new Error("PostMessageBridge is unavailable outside a browser environment"));const g=Qa(10);return new Promise((A,k)=>{const B=setTimeout(()=>{this.pendingRequests.has(g)&&(this.pendingRequests.delete(g),k(new Error("Request timeout")))},Md),D=O=>{clearTimeout(B),k(O)};this.pendingRequests.set(g,{resolve:O=>{clearTimeout(B),A(O)},reject:D});try{this.post(this.targetWindow,{type:r,payload:c,id:g})}catch(O){this.pendingRequests.delete(g),D(O instanceof Error?O:new Error("Failed to post message"))}})};broadcast=r=>{if(this.available)try{this.post(this.targetWindow,{type:r.type,payload:r.payload})}catch{}};destroy=()=>{Zo.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(r=>{r.reject(new Error("Bridge destroyed"))}),this.pendingRequests.clear()}},Ud=class Cr{static instance;bridges=new Map;constructor(){}static getInstance(){return Cr.instance||(Cr.instance=new Cr),Cr.instance}connectClient=({id:c,targetOrigin:g,targetWindow:A,channel:k})=>{const B=new Pd(A,g,k);if(c||(c=Qa(10)),this.bridges.has(c))throw new Error(`Bridge ${c} already exists`);return this.bridges.set(c,B),{bridge:B,id:c}};getClient=c=>this.bridges.get(c);removeClient=c=>{const g=this.bridges.get(c);g&&(g.destroy(),this.bridges.delete(c))};removeAllClient=()=>{this.bridges.forEach(c=>{c.destroy()}),this.bridges.clear()};broadcast=c=>{this.bridges.forEach(g=>{g.broadcast(c)})};sendTo=(c,g,A)=>{const k=this.getClient(c);return k?k.send(g,A):Promise.reject(new Error(`Bridge ${c} not found`))}},zg=Ud.getInstance(),Vg=new vs,z=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],N=class{highOrder;lowOrder;constructor(r,c){this.highOrder=r,this.lowOrder=c}},qg=[new N(z[0],3609767458),new N(z[1],602891725),new N(z[2],3964484399),new N(z[3],2173295548),new N(z[4],4081628472),new N(z[5],3053834265),new N(z[6],2937671579),new N(z[7],3664609560),new N(z[8],2734883394),new N(z[9],1164996542),new N(z[10],1323610764),new N(z[11],3590304994),new N(z[12],4068182383),new N(z[13],991336113),new N(z[14],633803317),new N(z[15],3479774868),new N(z[16],2666613458),new N(z[17],944711139),new N(z[18],2341262773),new N(z[19],2007800933),new N(z[20],1495990901),new N(z[21],1856431235),new N(z[22],3175218132),new N(z[23],2198950837),new N(z[24],3999719339),new N(z[25],766784016),new N(z[26],2566594879),new N(z[27],3203337956),new N(z[28],1034457026),new N(z[29],2466948901),new N(z[30],3758326383),new N(z[31],168717936),new N(z[32],1188179964),new N(z[33],1546045734),new N(z[34],1522805485),new N(z[35],2643833823),new N(z[36],2343527390),new N(z[37],1014477480),new N(z[38],1206759142),new N(z[39],344077627),new N(z[40],1290863460),new N(z[41],3158454273),new N(z[42],3505952657),new N(z[43],106217008),new N(z[44],3606008344),new N(z[45],1432725776),new N(z[46],1467031594),new N(z[47],851169720),new N(z[48],3100823752),new N(z[49],1363258195),new N(z[50],3750685593),new N(z[51],3785050280),new N(z[52],3318307427),new N(z[53],3812723403),new N(z[54],2003034995),new N(z[55],3602036899),new N(z[56],1575990012),new N(z[57],1125592928),new N(z[58],2716904306),new N(z[59],442776044),new N(z[60],593698344),new N(z[61],3733110249),new N(z[62],2999351573),new N(z[63],3815920427),new N(3391569614,3928383900),new N(3515267271,566280711),new N(3940187606,3454069534),new N(4118630271,4000239992),new N(116418474,1914138554),new N(174292421,2731055270),new N(289380356,3203993006),new N(460393269,320620315),new N(685471733,587496836),new N(852142971,1086792851),new N(1017036298,365543100),new N(1126000580,2618297676),new N(1288033470,3409855158),new N(1501505948,4234509866),new N(1607167915,987167468),new N(1816402316,1246189591)],_g=[new N(0,1),new N(0,32898),new N(2147483648,32906),new N(2147483648,2147516416),new N(0,32907),new N(0,2147483649),new N(2147483648,2147516545),new N(2147483648,32777),new N(0,138),new N(0,136),new N(0,2147516425),new N(0,2147483658),new N(0,2147516555),new N(2147483648,139),new N(2147483648,32905),new N(2147483648,32771),new N(2147483648,32770),new N(2147483648,128),new N(0,32778),new N(2147483648,2147483658),new N(2147483648,2147516545),new N(2147483648,32896),new N(0,2147483649),new N(2147483648,2147516424)],br=(r,c=500)=>{let g;return(...A)=>{clearTimeout(g),g=setTimeout(()=>{r.apply(void 0,A)},c)}},de=(r,c)=>{if(typeof document>"u")return;const g=r.classList;g.contains(c)||g.add(c)},be=(r,c)=>{if(typeof document>"u")return;const g=r.classList;g.contains(c)&&g.remove(c)},ys=()=>{let r=0,c=null;return function(g,A=300){return function(...k){const B=Date.now();B-r>=A?(c!=null&&(clearTimeout(c),c=null),r=B,g.apply(this,k)):c??=window.setTimeout(()=>{r=Date.now(),g.apply(this,k),c=null},A-(B-r))}}},Ia=new Map([[100,"Continue"],[101,"Switching Protocols"],[102,"Processing"],[103,"Early Hints"],[200,"OK"],[201,"Created"],[202,"Accepted"],[203,"Non-Authoritative Information"],[204,"No Content"],[205,"Reset Content"],[206,"Partial Content"],[207,"Multi-Status"],[208,"Already Reported"],[226,"IM Used"],[300,"Multiple Choices"],[301,"Moved Permanently"],[302,"Found"],[303,"See Other"],[304,"Not Modified"],[305,"Use Proxy"],[307,"Temporary Redirect"],[308,"Permanent Redirect"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Timeout"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Payload Too Large"],[414,"URI Too Long"],[415,"Unsupported Media Type"],[416,"Range Not Satisfiable"],[417,"Expectation Failed"],[418,"I'm a Teapot"],[421,"Misdirected Request"],[422,"Unprocessable Entity"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Timeout"],[505,"HTTP Version Not Supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[508,"Loop Detected"],[509,"Bandwidth Limit Exceeded"],[510,"Not Extended"],[511,"Network Authentication Required"]]),Wg={message:Ia,code:(function(r){const c=new Map;for(const[g,A]of r)c.set(A.toLowerCase(),g);return c})(Ia),codes:(function(r){const c=[];for(const[g,A]of r)c.push(g);return c})(Ia),redirect:{300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},empty:{204:!0,205:!0,304:!0},retry:{502:!0,503:!0,504:!0}},Qd='.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{box-sizing:var(--ran-btn-box-sizing, border-box);position:var(--ran-btn-position, relative);display:var(--ran-btn-display, inline-flex);background-image:var(--ran-btn-background-image, none);box-shadow:var(--ran-btn-box-shadow, var(--ran-skin-raised-shadow, 0 2px #00000004));cursor:var(--ran-btn-cursor, pointer);-webkit-user-select:var(--ran-btn-user-select, none);user-select:var(--ran-btn-user-select, none);touch-action:var(--ran-btn-touch-action, manipulation);overflow:var(--ran-btn-overflow, hidden);pointer-events:var(--ran-btn-pointer-events, auto)}:host .ran-btn{box-sizing:var(--ran-btn-contain-box-sizing, border-box);position:var(--ran-btn-contain-position, relative);display:var(--ran-btn-contain-display, block);background-image:var(--ran-btn-contain-background-image, none);cursor:var(--ran-btn-contain-cursor, pointer);transition:var(--ran-btn-contain-transition, opacity var(--ran-motion-duration-base, .2s) var(--ran-motion-ease-standard, cubic-bezier(.645, .045, .355, 1)));-webkit-user-select:var(--ran-btn-contain-user-select, none);user-select:var(--ran-btn-contain-user-select, none);touch-action:var(--ran-btn-contain-touch-action, manipulation);border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));background:var(--ran-btn-contain-background, var(--ran-color-bg-elevated, #fff))}:host,:host(:active),:host(:focus){outline:0;-webkit-tap-highlight-color:transparent}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:var(--ran-btn-contain-outline, 0)}:host(:focus-visible){outline:var(--ran-btn-focus-outline, 2px solid var(--ran-color-primary));outline-offset:var(--ran-btn-focus-outline-offset, 2px)}:host([type="primary"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-primary, #171717));background-image:var(--ran-btn-content-background-image, none);border-color:var(--ran-btn-content-border-color, var(--ran-color-primary, #171717));color:var(--ran-btn-content-color, var(--ran-color-primary-text, #fff))}:host([type="primary"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, var(--ran-color-primary-text, #fff) 10%, transparent 10.01%))}:host([type="primary"]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color, var(--ran-color-primary-active, #4d4d4d));border-color:var(--ran-btn-content-active-border-color, var(--ran-color-primary-active, #4d4d4d))}@media(min-width:1024px){:host(:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-border-hover, #c9c9c9));color:var(--ran-btn-content-hover-color, var(--ran-color-text, #171717))}:host([type="primary"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, var(--ran-color-primary-hover, #383838));border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-primary-hover, #383838));color:var(--ran-btn-content-hover-color, var(--ran-color-primary-text, #fff))}:host([type="warning"]:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));color:var(--ran-btn-content-warning-color, #fff)}}:host([type="warning"]) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));background-image:var(--ran-btn-content-background-image, none);color:var(--ran-btn-content-warning-color, #fff)}:host([type="warning"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="text"]) .ran-btn-content{border:var(--ran-btn-content-text-border, none)}:host([disabled]){cursor:var(--ran-btn-disabled-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-pointer-events, all);opacity:var(--ran-btn-disabled-opacity, .6)}:host([disabled]) .ran-btn{cursor:var(--ran-btn-disabled-container-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-container-pointer-events, all);opacity:var(--ran-btn-disabled-container-opacity, .6)}:host(:not([disabled]):active) .ran-btn:after{transform:var(--ran-btn-after-transform, translate(-50%, -50%) scale(0));opacity:var(--ran-btn-after-opacity, .3);transition:var(--ran-btn-after-transition, 0s)}:host(:not([disabled]):active) .ran-btn-content{transform:var(--ran-btn-content-active-transform, scale(.96))}@media(min-width:1024px){:host(:not([disabled],[effect])) .ran-btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--ran-x, 0);top:var(--ran-y, 0);pointer-events:none;background-image:radial-gradient(circle,var(--ran-gray-alpha-400, #00000014) 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}}:host .slot{display:var(--ran-btn-slot-display, block)}.ran-btn-content{display:var(--ran-btn-content-display, flex);justify-content:var(--ran-btn-content-display, space-between);align-items:var(--ran-btn-content-align-items, center);padding:var(--ran-btn-content-padding, 4px 15px);border:var(--ran-btn-content-border, 1px solid transparent);border-image-source:var(--ran-btn-content-border-image-source, none);border-image-slice:var(--ran-btn-content-border-image-slice, 8);border-image-width:var(--ran-btn-content-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));border-color:var(--ran-btn-content-border-color, var(--ran-color-border, #eaeaea));color:var(--ran-btn-content-color, var(--ran-color-text, #000000d9));line-height:var(--ran-btn-content-line-height, 22px);font-size:var(--ran-btn-content-font-size, 14px);font-weight:var(--ran-btn-content-font-weight, 400);font-family:var(--ran-btn-content-font-family, var(--ran-skin-font-family, inherit));white-space:var(--ran-btn-content-white-space, nowrap);text-align:var(--ran-btn-content-text-align, center);box-sizing:var(--ran-btn-content-box-sizing, border-box);transition:var(--ran-btn-content-transition, transform var(--ran-motion-duration-base, .2s) var(--ran-motion-ease-spring, cubic-bezier(.34, 1.26, .5, 1)))}.ran-btn-content .icon{margin-right:var(--ran-btn-icon-margin-right, 2px)}@media(prefers-reduced-motion:reduce){.ran-btn-content{transition:none}}',zt=typeof document>"u",xt=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(r,c,g,A){return r.addEventListener(c,g,{...A,signal:this.ac.signal}),this}delegate(r,c,g,A,k){return r.addEventListener(g,B=>{const D=B.target?.closest(c);D&&r.contains(D)&&A(B,D)},{...k,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}},ui=0,ws=1,Ai=2,ye=null,jt=null,Cs=0,di=new Set,Ba=!1;function qa(r,c){const g=c?.equals??Object.is,A={value:r,observers:new Set};return[()=>(Kd(A),A.value),D=>{const O=typeof D=="function"?D(A.value):D;if(!g(A.value,O)){A.value=O;for(const Y of A.observers)_a(Y,Ai);Cs===0&&Yd()}}]}function Ee(r){const c=Nd(r,!0);return Hd(c),ks(c),()=>Wa(c)}function mi(r){const c={owned:[],cleanups:[],owner:jt},g=jt,A=ye;jt=c,ye=null;try{return r(()=>Gd(c))}finally{jt=g,ye=A}}function vi(r){jt&&jt.cleanups.push(r)}function Nd(r,c,g){return{fn:r,sources:new Set,isEffect:c,running:!1,disposed:!1,state:Ai,observers:new Set,value:void 0,equals:g??Object.is,owned:[],cleanups:[],owner:jt}}function Hd(r){jt&&jt.owned.push(r)}function Kd(r){ye&&(ye.sources.add(r),r.observers.add(ye))}function _a(r,c){if(r.disposed||r.state>=c)return;const g=r.state===ui;if(r.state=c,r.isEffect)di.add(r);else if(g)for(const A of r.observers)_a(A,ws)}function Yd(){if(!(Cs>0||Ba)){Ba=!0;try{for(;di.size>0;){const r=[...di];di.clear();for(const c of r)c.disposed||Es(c)}}finally{Ba=!1}}}function Es(r){if(!(r.disposed||r.state===ui)){if(r.state===ws)for(const c of r.sources)"fn"in c&&Es(c);r.state===Ai&&ks(r),r.state=ui}}function ks(r){if(r.running)throw new Error("ranui reactivity: cyclic dependency detected (a computation triggered itself).");Is(r);const c=ye,g=jt;ye=r,jt=r,r.running=!0,r.state=ui;try{const A=r.fn();if(r.isEffect)typeof A=="function"&&r.cleanups.push(A);else{const k=r.value;if(r.value=A,r.observers.size>0&&!r.equals(k,A))for(const B of r.observers)_a(B,Ai)}}finally{r.running=!1,ye=c,jt=g}}function Is(r){for(const c of r.owned)Wa(c);r.owned.length=0;for(const c of r.cleanups)c();r.cleanups.length=0;for(const c of r.sources)c.observers.delete(r);r.sources.clear()}function Wa(r){r.disposed||(r.disposed=!0,Is(r),r.observers.clear())}function Gd(r){for(const c of r.owned)Wa(c);r.owned.length=0;for(const c of r.cleanups)c();r.cleanups.length=0}function je(r){return typeof r!="string"?String(r):r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Jo(r){return je(r)}var zd=r=>typeof r=="string"?!1:"tagName"in r&&"childrenList"in r,Vd=(r,c)=>{const g=c.trim();if(!g)return!1;if(g.startsWith("."))return r.classList.contains(g.slice(1));if(g.startsWith("#"))return r.getAttribute("id")===g.slice(1);if(g.startsWith("[")&&g.endsWith("]")){const[A,k]=g.slice(1,-1).trim().split("="),B=(A||"").trim();if(!B)return!1;if(k==null)return r.hasAttribute(B);const D=k.trim().replace(/^['"]|['"]$/g,"");return r.getAttribute(B)===D}return r.tagName===g.toLowerCase()},bi=(r,c,g)=>{for(const A of r)zd(A)&&(Vd(A,c)&&g.push(A),bi(A.childrenList,c,g))},Na=class{childrenList=[];appendChild(r){return this.childrenList.push(r),r}serialize(){return this.childrenList.map(r=>typeof r=="string"?je(r):r.serialize()).join("")}querySelector(r){const c=this.querySelectorAll(r);return c.length>0?c[0]:null}querySelectorAll(r){const c=[];return bi(this.childrenList,r,c),c}},Xa=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(r,c)=>{const g=r.startsWith("--")?r:r.replace(/([A-Z])/g,"-$1").toLowerCase();this.inlineStyles.set(g,c)},removeProperty:r=>this.inlineStyles.delete(r)};classList={add:(...r)=>{const c=this.attributes.get("class")||"",g=new Set([...c.split(" ").filter(Boolean),...r]);this.attributes.set("class",Array.from(g).join(" "))},remove:(...r)=>{const c=(this.attributes.get("class")||"").split(" ").filter(g=>!r.includes(g));this.attributes.set("class",c.join(" "))},toggle:r=>{this.classList.contains(r)?this.classList.remove(r):this.classList.add(r)},contains:r=>(this.attributes.get("class")||"").split(" ").includes(r)};_innerHTML="";get innerHTML(){return this._innerHTML}set innerHTML(r){this._innerHTML=r,this.tagName==="template"&&this.content&&(this.content.childrenList=[r])}constructor(r="div"){this.tagName=r.toLowerCase(),this.tagName==="template"&&(this.content=new Na)}get hidden(){return this.hasAttribute("hidden")}set hidden(r){r?this.setAttribute("hidden",""):this.removeAttribute("hidden")}setAttribute(r,c){this.attributes.set(r,c)}getAttribute(r){return this.attributes.get(r)||null}removeAttribute(r){this.attributes.delete(r)}hasAttribute(r){return this.attributes.has(r)}appendChild(r){return this.childrenList.push(r),r}attachShadow(r){return this.shadowRoot=new qd(this,r),this.shadowRoot}querySelector(r){const c=this.querySelectorAll(r);return c.length>0?c[0]:null}querySelectorAll(r){const c=[];return bi(this.childrenList,r,c),c}addEventListener(r,c){const g=this.eventListeners.get(r)||new Set;g.add(c),this.eventListeners.set(r,g)}removeEventListener(r,c){const g=this.eventListeners.get(r);g&&(g.delete(c),g.size===0&&this.eventListeners.delete(r))}dispatchEvent(r){const c=this.eventListeners.get(r.type);if(!c||c.size===0)return!0;for(const g of c)typeof g=="function"?g.call(this,r):g.handleEvent(r);return!r.defaultPrevented}serialize(r){typeof this._preSerialize=="function"&&this._preSerialize();const c=r||this._ssrTag||this.tagName,g=Array.from(this.attributes.entries()).map(([D,O])=>` ${D}="${Jo(O)}"`).join(""),A=Array.from(this.inlineStyles.entries()).map(([D,O])=>`${D}:${O}`).join(";"),k=A?` style="${Jo(A)}"`:"";let B="";return this.shadowRoot&&(B+=this.shadowRoot.serialize()),this.textContent!==null?B+=je(this.textContent):this._innerHTML?B+=this._innerHTML:B+=this.childrenList.map(D=>typeof D=="string"?je(D):(D instanceof Na,D.serialize())).join(""),["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"].includes(c)&&!B?`<${c}${g}${k} />`:`<${c}${g}${k}>${B}</${c}>`}},qd=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(r,c){this.host=r,this.options=c}appendChild(r){return this.childrenList.push(r),r}querySelector(r){const c=this.querySelectorAll(r);return c.length>0?c[0]:null}querySelectorAll(r){const c=[];return bi(this.childrenList,r,c),c}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?" shadowrootdelegatesfocus":""}>${this.adoptedStyleSheets.map(r=>`<style>${je(r)}</style>`).join("")}${this.childrenList.map(r=>typeof r=="string"?je(r):(r instanceof Na,r.serialize())).join("")}</template>`}},Bs=r=>r.reduce((c,g)=>Array.isArray(g)?c.concat(Bs(g)):c.concat(g),[]),Sr=r=>r==null?null:r instanceof Ss?r.build():typeof r=="string"?zt?r:document.createTextNode(r):r,_d=(r,c)=>{if(zt){gi(r,[c()]);return}const g=document.createComment(""),A=document.createComment("");r.appendChild(g),r.appendChild(A);let k=null;const B=()=>{k?.(),k=null;let D=g.nextSibling;for(;D&&D!==A;){const O=D.nextSibling;D.parentNode?.removeChild(D),D=O}};Ee(()=>{const D=c();B();const O=document.createDocumentFragment();k=mi(Y=>(gi(O,[D]),Y)),A.parentNode?.insertBefore(O,A)}),vi(()=>k?.())},Wd="__ranFor",Xd=r=>typeof r=="object"&&r!==null&&r[Wd]===!0,Zd=(r,c,g)=>{const[A,k]=qa(c);let B=null;const D=mi(O=>{const Y=Sr(g(r,A));return B=typeof Y=="string"?document.createTextNode(Y):Y,O});return{node:B,index:k,dispose:D}},Ls=(r,c)=>{const g=r.parentNode;if(!g)return;let A=r;for(const k of c)A.nextSibling!==k&&g.insertBefore(k,A.nextSibling),A=k},Jd=(r,c)=>{if(zt){(c.each()??[]).forEach((k,B)=>{const D=Sr(c.render(k,()=>B));D!=null&&r.appendChild(D)});return}const g=document.createComment("");r.appendChild(g);let A=new Map;vi(()=>{for(const k of A.values())k.dispose();A.clear()}),Ee(()=>{const k=c.each()??[],B=new Map,D=[];k.forEach((O,Y)=>{const X=c.key(O,Y);if(B.has(X))return;let wt=A.get(X);wt?(A.delete(X),wt.index(Y)):wt=Zd(O,Y,c.render),B.set(X,wt),wt.node&&D.push(wt.node)});for(const O of A.values())O.node?.parentNode?.removeChild(O.node),O.dispose();Ls(g,D),A=B})},jd="__ranIndex",$d=r=>typeof r=="object"&&r!==null&&r[jd]===!0,th=(r,c,g)=>{const[A,k]=qa(r);let B=null;const D=mi(O=>{const Y=Sr(g(A,c));return B=typeof Y=="string"?document.createTextNode(Y):Y,O});return{node:B,setItem:k,dispose:D}},eh=(r,c)=>{if(zt){(c.each()??[]).forEach((k,B)=>{const D=Sr(c.render(()=>k,B));D!=null&&r.appendChild(D)});return}const g=document.createComment("");r.appendChild(g);let A=[];vi(()=>{for(const k of A)k.dispose();A=[]}),Ee(()=>{const k=c.each()??[];for(let B=0;B<k.length;B++)B<A.length?A[B].setItem(k[B]):A.push(th(k[B],B,c.render));for(let B=A.length-1;B>=k.length;B--){const{node:D}=A[B];D?.parentNode?.removeChild(D),A[B].dispose(),A.pop()}Ls(g,A.map(B=>B.node).filter(B=>B!=null))})},gi=(r,c)=>{Bs(c).forEach(g=>{if(Xd(g)){Jd(r,g);return}if($d(g)){eh(r,g);return}if(typeof g=="function"){_d(r,g);return}const A=Sr(g);A!=null&&r.appendChild(A)})},Ss=class{el;constructor(r){this.el=zt?new Xa(r):document.createElement(r)}id(r){return this.el.setAttribute("id",r),this}bind(r,c){typeof r=="function"?Ee(()=>c(r())):c(r)}class(r){return this.bind(r,c=>{zt?this.el.attributes.set("class",c):this.el.className=c}),this}addClass(...r){return r.forEach(c=>this.el.classList.add(c)),this}removeClass(...r){return r.forEach(c=>this.el.classList.remove(c)),this}attr(r,c){return this.bind(c,g=>this.el.setAttribute(r,g)),this}attrs(r){return Object.entries(r).forEach(([c,g])=>{g!=null&&this.el.setAttribute(c,String(g))}),this}boolAttr(r,c,g=""){return this.bind(c,A=>{A?this.el.setAttribute(r,g):this.el.removeAttribute(r)}),this}part(r){return this.attr("part",r)}data(r,c){return this.attr(`data-${r}`,c)}style(r,c){return typeof r=="string"?this.bind(c??"",g=>this.el.style.setProperty(r,g)):Object.entries(r).forEach(([g,A])=>this.el.style.setProperty(g,A)),this}cssVar(r,c){const g=r.startsWith("--")?r:`--${r}`;return this.style(g,c)}aria(r,c){return this.attr(`aria-${r}`,c)}role(r){return this.attr("role",r)}tabIndex(r){return this.attr("tabindex",String(r))}label(r){return this.aria("label",r)}labelledBy(r){return this.aria("labelledby",r)}describedBy(r){return this.aria("describedby",r)}ariaHidden(r=!0){return this.aria("hidden",String(r))}on(r,c,g){return this.el.addEventListener(r,c,g),this}listen(r,c,g,A){return r.on(this.el,c,g,A),this}delegate(r,c,g,A,k){return r.delegate(this.el,c,g,A,k),this}children(...r){return gi(this.el,r),this}replaceChildren(...r){if(zt){const c=this.el;c.childrenList=[]}else this.el.replaceChildren();return this.children(...r)}text(r){return this.bind(r,c=>{this.el.textContent=c}),this}ref(r){return r.current=this.el,this}shadow(r={mode:"closed"}){const c=this.el.attachShadow(r);return new rh(this.el,c,r)}build(){return this.el}serialize(){if(zt)return this.el.serialize();const r=document.createElement("div");return r.appendChild(this.el.cloneNode(!0)),r.innerHTML}},rh=class{root;hostEl;options;constructor(r,c,g){this.hostEl=r,this.root=c,this.options=g}children(...r){return gi(this.root,r),this}adoptSheet(...r){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...r],this}css(r){if(zt)return this.root.adoptedStyleSheets.push(r),this;if(typeof CSSStyleSheet<"u")try{const g=new CSSStyleSheet;return g.replaceSync(r),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,g],this}catch{}const c=document.createElement("style");return c.textContent=r,this.root.appendChild(c),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return zt?this.root.serialize():this.root.innerHTML}},rt=r=>new Ss(r),x=()=>rt("div"),ke=()=>rt("span"),Bt=()=>rt("slot"),Ha=()=>rt("button"),Za=()=>rt("input"),ih=()=>rt("style"),ah=()=>rt("label"),ce=[!1,"false",null,void 0],yt=r=>{const c=r.hasAttribute("disabled"),g=r.getAttribute("disabled");return!!(c&&!ce.includes(g))},xs=new Map;function dt(r,c){zt?(xs.set(r,c),c.prototype._ssrTag=r):customElements.get(r)||customElements.define(r,c)}function nh(){return xs}var Ts=()=>typeof document<"u"?HTMLElement:Xa,ct=Ts(),oh=r=>{if(r.tagName&&r.tagName!=="div")return r.tagName;const c=nh();for(const[g,A]of c)if(r instanceof A)return g;return r.constructor.name.toLowerCase()},sh=r=>{if(!r)return"";const c=oh(r);return typeof r.serialize=="function"||r instanceof Xa?r.serialize(c):""},La=new Map,Sa=new Map,lh=(r,c)=>{if(!(typeof document>"u")&&c){if(typeof CSSStyleSheet<"u")try{if(!La.has(c)){const A=new CSSStyleSheet;A.replaceSync(c),La.set(c,A)}const g=La.get(c);r.adoptedStyleSheets.includes(g)||(r.adoptedStyleSheets=[...r.adoptedStyleSheets,g]);return}catch{}if(!r.querySelector("style[data-ranui]")){const g=document.createElement("style");g.setAttribute("data-ranui",""),g.textContent=c,r.appendChild(g)}}},ch=(r,c)=>{if(!(typeof document>"u")&&c){if(typeof CSSStyleSheet<"u")try{if(!Sa.has(c)){const A=new CSSStyleSheet;A.replaceSync(c),Sa.set(c,A)}const g=Sa.get(c);r.adoptedStyleSheets.includes(g)||(r.adoptedStyleSheets=[...r.adoptedStyleSheets,g]);return}catch{}if(!Array.from(r.querySelectorAll("style[data-ranui-sheet]")).some(g=>g.textContent===c)){const g=document.createElement("style");g.setAttribute("data-ranui-sheet",""),g.textContent=c,r.appendChild(g)}}},jo=new WeakMap,$o="@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}",ht=(r,c="",g={mode:"closed"})=>{const A=r.shadowRoot||jo.get(r)||r.attachShadow(g);return jo.set(r,A),lh(A,c?`${c}
|
|
2
2
|
${$o}`:$o),A},gt=(r,c,g)=>{const A=r.querySelector(c);if(A)return A;const k=g();return r.appendChild(k),k},_=(r,c,g="")=>r.getAttribute(c)??g,$=(r,c,g,A={})=>{if(A.removeEmpty&&!g){r.removeAttribute(c);return}r.setAttribute(c,g??"")},xa=(r,c,g,A={})=>{if(g){r.setAttribute(c,""),A.aria&&r.setAttribute(`aria-${A.aria}`,"true");return}r.removeAttribute(c),A.aria&&r.removeAttribute(`aria-${A.aria}`)},ut=(r,c,g,A,k)=>{if(g!=="sheet"||A===k)return;const B=r.getAttribute("sheet")||"";B&&ch(c,B)},Ds=class extends ct{_btn;_btnContent;_iconElement;_slot;_shadowDom;_events=new xt;debounceTimeId;static get observedAttributes(){return["disabled","icon","effect","iconSize","type","sheet"]}constructor(){super(),this._shadowDom=ht(this,Qd);const r=gt(this._shadowDom,".ran-btn",()=>x().class("ran-btn").attr("part","button").role("button").tabIndex(0).children(x().class("ran-btn-content").attr("part","content").children(Bt().class("slot"))).build());this._btn=r,this._btnContent=r.querySelector(".ran-btn-content"),this._slot=r.querySelector("slot")}get sheet(){return this.getAttribute("sheet")||""}set sheet(r){this.setAttribute("sheet",r||""),this.handlerExternalCss()}get disabled(){return yt(this)}set disabled(r){!r||r==="false"?(this.removeAttribute("disabled"),this.removeAttribute("aria-disabled")):(this.setAttribute("disabled",""),this.setAttribute("aria-disabled","true"))}get iconSize(){return this.getAttribute("iconSize")||""}set iconSize(r){!r||r==="false"?this.removeAttribute("iconSize"):(this.setAttribute("iconSize",r),this.setIcon())}get icon(){return this.getAttribute("icon")||""}set icon(r){!r||r==="false"?this.removeAttribute("icon"):(this.setAttribute("icon",r),this.setIcon())}get effect(){return this.getAttribute("effect")||""}set effect(r){ce.includes(r)||!r?this.removeAttribute("effect"):this.setAttribute("effect",r)}get type(){return this.getAttribute("type")||""}set type(r){r?this.setAttribute("type",r):this.removeAttribute("type")}setIcon=()=>{if(typeof document>"u"||!this._slot)return;const r=this.icon;if(!r){this._iconElement&&(this._iconElement.remove(),this._iconElement=void 0);return}if(this._iconElement)this._iconElement.setAttribute("name",r);else{let B=this._shadowDom.querySelector("r-icon");B||(B=rt("r-icon").attr("color","currentColor").class("icon").build(),this._slot.insertAdjacentElement("beforebegin",B)),this._iconElement=B,this._iconElement.setAttribute("name",r)}const{width:c,height:g}=this._slot.getBoundingClientRect(),A=Math.min(c,g)||16,k=this.iconSize||`${A>5?A-5:A}`;this._iconElement.setAttribute("size",String(k))};mousedown=r=>{if(Xo()==="pc"&&!this.disabled){this.debounceMouseEvent();const{left:c,top:g}=this.getBoundingClientRect();this._btn.style.setProperty("--ran-x",`${r.clientX-c}px`),this._btn.style.setProperty("--ran-y",`${r.clientY-g}px`)}};mouseup=()=>{Xo()==="pc"&&(this.debounceTimeId||(this.debounceTimeId=setTimeout(()=>{this._btn.style.removeProperty("--ran-x"),this._btn.style.removeProperty("--ran-y"),this.debounceMouseEvent()},600)))};keydown=r=>{yt(this)||(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),this.click())};debounceMouseEvent=()=>{this.debounceTimeId&&(clearTimeout(this.debounceTimeId),this.debounceTimeId=void 0)};handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};syncA11yState=()=>{const r=yt(this);this._btn.setAttribute("aria-disabled",r?"true":"false"),this._btn.tabIndex=r?-1:0,r?(this.setAttribute("aria-disabled","true"),this._btnContent.setAttribute("disabled","true")):(this.removeAttribute("aria-disabled"),this._btnContent.removeAttribute("disabled"))};connectedCallback(){this.handlerExternalCss(),this.setIcon(),this.syncA11yState(),this._events.on(this._btn,"mousedown",this.mousedown).on(this._btn,"mouseup",this.mouseup).on(this._btn,"keydown",this.keydown)}disconnectedCallback(){this.debounceMouseEvent(),this._events.abort()}attributeChangedCallback(r,c,g){c!==g&&(r==="disabled"&&this._btnContent&&this.syncA11yState(),(r==="icon"||r==="iconSize")&&this.setIcon(),r==="sheet"&&this.handlerExternalCss())}};dt("r-button",Ds);var dh=".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{display:var(--ran-icon-host-display, inline-flex)}:host([spin]){animation-name:var(--ran-icon-host-spin-animation-name, rotate);animation-duration:var(--ran-icon-host-spin-animation-name, 1.4s);animation-timing-function:linear;animation-iteration-count:var(--ran-icon-host-spin-animation-name, infinite)}.ran-icon{display:var(--ran-icon-display, flex);align-items:var(--ran-icon-align-items, center);justify-content:var(--ran-icon-justify-content, center);color:var(--ran-icon-color, inherit);font-size:var(--ran-icon-font-size, 1em);margin:var(--ran-icon-margin, 0)}.ran-icon svg{width:var(--ran-icon-svg-width, 1em);height:var(--ran-icon-svg-height, 1em);fill:var(--ran-icon-svg-fill, currentColor);stroke:var(--ran-icon-svg-stroke, currentColor)}@keyframes rotate{to{transform:var(--ran-icon-keyframes-to-transform, rotate(360deg))}}",Rs={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></g></svg>'},Ms={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></g></svg>'},Fs={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></g></svg>'},Os={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3M8 21H5a2 2 0 0 1-2-2v-3m18 0v3a2 2 0 0 1-2 2h-3"/></g></svg>'},Ps={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></g></svg>'},Us={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="8" y1="11" x2="14" y2="11"/></g></svg>'},Qs={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></g></svg>'},hh={copy:Rs,check:Ms,download:Fs,fullscreen:Os,"zoom-in":Ps,"zoom-out":Us,refresh:Qs},uh=!1,Ns=new Map,Ja=!1,Er=r=>/<svg[\s>]/i.test(r),gh=r=>{if(typeof r=="string")return Er(r)?r:void 0;if(!r||typeof r!="object")return;const c=r,g=c.data;if(typeof g=="string"&&Er(g))return g;const A=c.default;if(typeof A=="string"&&Er(A))return A;if(A&&typeof A=="object"){const k=A;if(typeof k.data=="string"&&Er(k.data))return k.data}},ja=(r,c)=>{Ja=!0;const g=gh(c);g&&(Ns.set(`inline:${r}`,g),typeof window<"u"&&window.dispatchEvent(new CustomEvent("ranui-icon-registered",{detail:{name:r}})))},yi=r=>{Ja=!0,Object.entries(r).forEach(([c,g])=>{ja(c,g)})};yi(hh);var fh=["add-user","arrow-down","book","check","check-circle","check-circle-fill","close","close-circle","close-circle-fill","copy","download","drop","eye","eye-close","fullscreen","github","globe","home","info-circle","info-circle-fill","issue","loading","loading-scene","lock","menu","message","more","plus","power-off","preview","refresh","search","setting","sort","team","unlock","user","warning-circle","warning-circle-fill","without-content","zoom-in","zoom-out"],Hs=class extends ct{isDev=uh;_events=new xt;static get observedAttributes(){return["name","size","color","spin","decorative","aria-label","sheet"]}_icon;_div;_shadowDom;_onIconRegistered=r=>{const c=r.detail?.name;c&&c===this.name&&!this._icon&&this.setIcon()};constructor(){super(),this._shadowDom=ht(this,dh);const r=gt(this._shadowDom,".ran-icon",()=>x().class("ran-icon").part("ran-icon").build());this._div=r}get name(){return _(this,"name")}set name(r){r&&this.setAttribute("name",r)}get size(){return _(this,"size")}set size(r){r&&this.setAttribute("size",r)}get color(){return _(this,"color")}set color(r){r&&this.setAttribute("color",r)}get spin(){return this.hasAttribute("spin")}set spin(r){r?this.setAttribute("spin",""):this.removeAttribute("spin")}get decorative(){const r=this.getAttribute("decorative");return r==null?!this.hasAttribute("aria-label"):r!=="false"&&r!=="0"}set decorative(r){this.setAttribute("decorative",r?"true":"false")}get ariaLabel(){return _(this,"aria-label")}set ariaLabel(r){$(this,"aria-label",r,{removeEmpty:!0})}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};syncA11y=()=>{if(this._icon){if(this.decorative){this.setAttribute("aria-hidden","true"),this.removeAttribute("role"),this._icon.setAttribute("aria-hidden","true"),this._icon.setAttribute("focusable","false");return}this.removeAttribute("aria-hidden"),this.setAttribute("role","img"),this._icon.removeAttribute("aria-hidden"),this._icon.setAttribute("focusable","false")}};setIcon=()=>{if(typeof document>"u")return;this._icon&&(this._icon.remove(),this._icon=void 0);const r=this.name;if(r)if(r.startsWith("<svg"))this.renderSvg(r,r);else try{const c=`inline:${r}`,g=Ns.get(c);if(!g){this.isDev&&Ja&&console.warn(`[ranui-icon] icon not registered: ${r}`);return}g&&this.isSvgText(g)?this.renderSvg(g,r):this.isDev&&console.warn(`[ranui-icon] invalid svg text: ${r}`)}catch(c){this.isDev&&console.warn(`[ranui-icon] render icon failed: ${r}`,c)}};isSvgText=r=>Er(r);parseSvg=r=>{const c=new window.DOMParser().parseFromString(r,"image/svg+xml").documentElement;if(!c||c.tagName.toLowerCase()==="parsererror"||c.tagName.toLowerCase()!=="svg")return;const g=new XMLSerializer().serializeToString(c),A=rt("template").build();A.innerHTML=g.trim();const k=A.content.firstElementChild;if(!(!k||k.tagName.toLowerCase()!=="svg"))return k};renderSvg=(r,c)=>{const g=this.parseSvg(r);g?(this._icon=g,this._icon.setAttribute("part","icon-svg"),this._icon.setAttribute("data-name",c),this._div.appendChild(this._icon),this.setSize(),this.setColor(),this.setSpin(),this.syncA11y()):this.isDev&&console.warn(`[ranui-icon] parse svg failed: ${c}`)};setSize=()=>{if(this._icon){const r=this.size||"1em";this._icon.setAttribute("width",r),this._icon.setAttribute("height",r);const c=/^\d+(\.\d+)?$/.test(r)?`${r}px`:r;this._icon.style.setProperty("width",c),this._icon.style.setProperty("height",c)}};setColor=()=>{if(this._icon){const r=this.color||"currentColor";this._icon.style.setProperty("color",r),this._icon.style.setProperty("fill",r),this._icon.style.setProperty("stroke",r)}};setSpin=()=>{this.spin?this._div.classList.add("ran-icon-spin"):this._div.classList.remove("ran-icon-spin")};connectedCallback(){this._events.on(window,"ranui-icon-registered",this._onIconRegistered),this.handlerExternalCss(),this.setIcon()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(r,c,g){c!==g&&(r==="name"&&this.setIcon(),r==="size"&&this.setSize(),r==="color"&&this.setColor(),r==="spin"&&this.setSpin(),(r==="decorative"||r==="aria-label")&&this.syncA11y(),r==="sheet"&&this.handlerExternalCss())}};dt("r-icon",Hs);var ph={success:!0,_identification:!0,data:`<svg t="1667110768583" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
|
3
3
|
xmlns="http://www.w3.org/2000/svg" p-id="8046" width="200" height="200">
|
|
4
4
|
<path
|
|
@@ -238,7 +238,7 @@ ${$o}`:$o),A},gt=(r,c,g)=>{const A=r.querySelector(c);if(A)return A;const k=g();
|
|
|
238
238
|
<path d="M484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53c12.1-8.7 20-22.9 20-39 0-26.5-21.5-48-48-48s-48 21.5-48 48c0 16.1 7.9 30.3 20 39z" p-id="8187"></path>
|
|
239
239
|
</svg>`},Gh={success:!0,_identification:!0,data:'<svg t="1667483498347" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8544" width="200" height="200"><path d="M858.5 763.6c-18.9-44.8-46.1-85-80.6-119.5-34.5-34.5-74.7-61.6-119.5-80.6-0.4-0.2-0.8-0.3-1.2-0.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-0.4 0.2-0.8 0.3-1.2 0.5-44.8 18.9-85 46-119.5 80.6-34.5 34.5-61.6 74.7-80.6 119.5C146.9 807.5 137 854 136 901.8c-0.1 4.5 3.5 8.2 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c0.1 4.4 3.6 7.8 8 7.8h60c4.5 0 8.1-3.7 8-8.2-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z" p-id="8545"></path></svg>'},Vs={success:!0,_identification:!0,data:'<svg t="1667965273540" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8989" width="200" height="200"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296z m32 440c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48z" p-id="8990"></path></svg>'},zh={success:!0,_identification:!0,data:'<svg t="1667895689016" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8572" width="200" height="200"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" p-id="8573"></path><path d="M512 688m-48 0a48 48 0 1 0 96 0 48 48 0 1 0-96 0Z" p-id="8574"></path><path d="M488 576h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z" p-id="8575"></path></svg>'},Vh={success:!0,_identification:!0,data:'<svg t="1742629778506" class="icon" viewBox="0 0 1366 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="31273" width="200" height="200"><path d="M1230.155 778.399V472.604l133.84-51.746-94.113-140.41 83.29 13.815 0.676-4.006 6.486-9.634L1204.75 176.19l-2.05 2.985 1.283-3.578L735.283 1.087 734 4.496l-1.197-3.494-550.626 182.523-0.338-0.598-2.303 1.619-0.43-0.083-0.597 0.85L0 311.57l7.076 9.972L8.78 325.8l97.353-40.064-70.926 98.38 140.747 78.94 0.168 312.863h3.838l-1.873 3.415 438.699 244.578 0.083-0.084v0.168l15.428-0.084v0.084l0.253-0.084h0.262v-0.084l597.428-245.262-0.085-0.168z m89.34-505.88l-61.802-10.223-38.106-56.866 99.908 67.09zM742.443 20.782l438.438 163.252-438.438 164.28V20.78z m451.654 175.355l145.522 217.047-605.703 234.1-100.084-241.176 560.265-209.97zM63.934 285.822l85.848-60.698-25.997 36.143-59.851 24.555z m-5.28 93.177L134.1 274.315l1.873-0.768-0.514-1.196 48.852-67.856 428.377 201.357-75.7 241.515L58.653 379zM192.07 768.85l-0.175-296.76 354.386 198.803 68.625-218.92 1.788 553.697L192.07 768.85z m8.184-574.587L726.5 19.843v334.433l-103.323 38.79-422.924-198.803z m1013.96 573.56L632.727 1006.52l-1.795-565.798 94.204 227.107 489.078-189v288.994z" fill="currentColor" p-id="31274"></path></svg>'},qh=Object.assign({"../../assets/icons/add-user.svg":ph,"../../assets/icons/arrow-down.svg":Ks,"../../assets/icons/book.svg":Ah,"../../assets/icons/check-circle-fill.svg":Ys,"../../assets/icons/check-circle.svg":mh,"../../assets/icons/check.svg":Ms,"../../assets/icons/close-circle-fill.svg":Gs,"../../assets/icons/close-circle.svg":vh,"../../assets/icons/close.svg":bh,"../../assets/icons/copy.svg":Rs,"../../assets/icons/download.svg":Fs,"../../assets/icons/drop.svg":yh,"../../assets/icons/eye-close.svg":wh,"../../assets/icons/eye.svg":Ch,"../../assets/icons/fullscreen.svg":Os,"../../assets/icons/github.svg":Eh,"../../assets/icons/globe.svg":kh,"../../assets/icons/home.svg":Ih,"../../assets/icons/info-circle-fill.svg":zs,"../../assets/icons/info-circle.svg":Bh,"../../assets/icons/issue.svg":Lh,"../../assets/icons/loading-scene.svg":Sh,"../../assets/icons/loading.svg":xh,"../../assets/icons/lock.svg":Th,"../../assets/icons/menu.svg":Dh,"../../assets/icons/message.svg":Rh,"../../assets/icons/more.svg":Mh,"../../assets/icons/plus.svg":Fh,"../../assets/icons/power-off.svg":Oh,"../../assets/icons/preview.svg":Ph,"../../assets/icons/refresh.svg":Qs,"../../assets/icons/search.svg":Uh,"../../assets/icons/setting.svg":Qh,"../../assets/icons/sort.svg":Nh,"../../assets/icons/sprite.svg":Hh,"../../assets/icons/team.svg":Kh,"../../assets/icons/unlock.svg":Yh,"../../assets/icons/user.svg":Gh,"../../assets/icons/warning-circle-fill.svg":Vs,"../../assets/icons/warning-circle.svg":zh,"../../assets/icons/without-content.svg":Vh,"../../assets/icons/zoom-in.svg":Ps,"../../assets/icons/zoom-out.svg":Us}),$a={};for(const[r,c]of Object.entries(qh)){const g=r.split("/").pop()?.replace(/\.svg$/,"");g&&g!=="sprite"&&($a[g]=c)}var _h=Object.keys($a).sort(),Wh=()=>{yi($a)},Xh=`
|
|
240
240
|
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==
|
|
241
|
-
`,Zh=".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}",qs=class extends ct{static get observedAttributes(){return["src","fallback","sheet","alt"]}_image;_container;_shadowDom;constructor(){super(),this._shadowDom=ht(this,Zh);const r=gt(this._shadowDom,".ran-image",()=>x().class("ran-image").build());this._container=r}get fallback(){return _(this,"fallback",Xh)}set fallback(r){$(this,"fallback",r,{removeEmpty:!0})}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}get alt(){return _(this,"alt")}set alt(r){$(this,"alt",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};listenFallback(r,c){r==="fallback"&&this._image&&(c?this._image.setAttribute("fallback",c):this._image.removeAttribute("fallback"))}updateSrc=()=>{this._image&&(this._image.src=this.getAttribute("src")||"")};connectedCallback(){this.handlerExternalCss(),this._image=new Image,this._image.alt=this.alt,this._image.addEventListener("error",()=>{this._image&&this.fallback&&(this._image.src=this.fallback)}),this._image.addEventListener("load",()=>{this._image&&this._container.appendChild(this._image)}),this.updateSrc()}attributeChangedCallback(r,c,g){c!==g&&(this.listenFallback(r,g),r==="src"&&this.updateSrc(),r==="alt"&&this._image&&(this._image.alt=g??""),r==="sheet"&&this.handlerExternalCss())}};dt("r-img",qs);var Jh=`.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{position:var(--ran-input-host-position, relative);display:var(--ran-input-host-display, block);box-sizing:var(--ran-input-host-box-sizing, border-box)}:host([placeholder]) .ran-input-label{transform:var(--ran-input-label-placeholder-transform, translateY( calc(-50% - .43em) ) scale(.8));top:var(--ran-input-label-placeholder-top, 0)}:host .ran-input-label{transform:var(--ran-input-label-transform, translateY(-50%));top:var(--ran-input-label-top, 50%)}.ran-input{box-sizing:var(--ran-input-box-sizing, border-box);position:var(--ran-input-position, relative);display:var(--ran-input-display, flex);width:var(--ran-input-width, 100%);height:var(--ran-input-height, auto);min-width:var(--ran-input-min-width, 0);padding:var(--ran-input-padding, 0px 0px 0px 4px);color:var(--ran-input-color, var(--ran-color-text, #000000d9));font-size:var(--ran-input-font-size, 12px);font-family:var(--ran-input-font-family, var(--ran-skin-font-family, inherit));line-height:var(--ran-input-line-height, 1.5715);background-color:var(--ran-input-background-color, var(--ran-color-bg-elevated, #fff));background-image:var(--ran-input-background-image, none);border:var(--ran-input-border, 1px solid var(--ran-color-border, #eaeaea));border-image-source:var(--ran-input-border-image-source, none);border-image-slice:var(--ran-input-border-image-slice, 8);border-image-width:var(--ran-input-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-input-border-radius, var(--ran-radius-sm, 6px));transition:var(--ran-input-transition, none);min-height:var(--ran-input-min-height, 32px)}.ran-input .ran-icon{display:var(--ran-input-icon-display, flex);align-items:var(--ran-input-icon-align-items, center);justify-content:var(--ran-input-icon-justify-content, center)}.ran-input:focus-within{border-color:var(--ran-input-active-border-color, var(--ran-color-primary, #006bff));box-shadow:var(--ran-input-active-box-shadow, 0 0 0 2px var(--ran-blue-400, #cae7ff));border-right-width:var(--ran-input-active-border-right-width, 1px);outline:var(--ran-input-active-outline, 0)}.ran-input:hover{border-color:var(--ran-input-hover-border-color, var(--ran-color-primary, #006bff));border-right-width:var(--ran-input-hover-border-right-width, 1px)}.ran-input>.ran-input-content:hover~.ran-input-label{color:var(--ran-input-label-hover-color, var(--ran-color-primary, #006bff))}.ran-input[value]>.ran-input-label{transform:var(--ran-input-label-value-transform, translateY( calc(-50% - .43em) ) scale(.8));color:var(--ran-input-label-value-color, var(--ran-color-text-disabled, #00000040))}.ran-input[status=error] .ran-input-content,.ran-input[status=warning] .ran-input-content{padding-right:var(--ran-input-content-status-padding-right, 28px)}.ran-input[status=error]:after,.ran-input[status=warning]:after{content:"";position:absolute;top:50%;right:10px;width:16px;height:16px;transform:translateY(-50%);pointer-events:none;mask-position:center;mask-repeat:no-repeat;mask-size:contain;-webkit-mask-position:center;-webkit-mask-repeat:no-repeat;-webkit-mask-size:contain}.ran-input[status=error]{border-color:var(--ran-input-status-error-border-color, var(--ran-color-danger, #ff4d4f))}.ran-input[status=error]>.ran-input-content~.ran-input-label{color:var(--ran-input-label-status-error-color, var(--ran-color-danger, #ff4d4f))}.ran-input[status=error]:after{background-color:var(--ran-color-danger, #ff4d4f);mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.75 3.5h1.5v5h-1.5v-5zM8 11a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.75 3.5h1.5v5h-1.5v-5zM8 11a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E")}.ran-input[status=warning]{border-color:var(--ran-input-status-warning-border-color, var(--ran-color-warning, #faad14))}.ran-input[status=warning]>.ran-input-content~.ran-input-label{color:var(--ran-input-label-status-warning-color, var(--ran-color-warning, #faad14))}.ran-input[status=warning]:after{background-color:var(--ran-color-warning, #faad14);mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l6.85 11.86a.5.5 0 01-.43.75H1.58a.5.5 0 01-.43-.75L8 1.5zm-.75 4.25v3.5h1.5v-3.5h-1.5zM8 10.75a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l6.85 11.86a.5.5 0 01-.43.75H1.58a.5.5 0 01-.43-.75L8 1.5zm-.75 4.25v3.5h1.5v-3.5h-1.5zM8 10.75a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E")}.ran-input[disabled]{color:var(--ran-input-disabled-color, var(--ran-color-text-disabled, #00000040));background-color:var(--ran-input-disabled-background-color, var(--ran-color-bg-muted, #f5f5f5));border-color:var(--ran-input-disabled-border-color, var(--ran-color-border, #eaeaea));box-shadow:var(--ran-input-disabled-box-shadow, none);cursor:var(--ran-input-disabled-cursor, not-allowed);opacity:var(--ran-input-disabled-opacity, 1)}.ran-input[disabled]>.ran-input-content{color:var(--ran-input-content-disabled-color, var(--ran-color-text-disabled, #00000040));background-color:var(--ran-input-content-disabled-background-color, var(--ran-color-bg-muted, #f5f5f5));border-color:var(--ran-input-content-disabled-border-color, var(--ran-color-border, #eaeaea));box-shadow:var(--ran-input-content-disabled-box-shadow, none);cursor:var(--ran-input-content-disabled-cursor, not-allowed);opacity:var(--ran-input-content-disabled-opacity, 1)}.ran-input[disabled]>.ran-input-content~.ran-input-label{color:var(--ran-input-label-disabled-color, var(--ran-color-text-disabled, #00000040));background-color:var(--ran-input-label-disabled-background-color, var(--ran-color-bg-muted, #f5f5f5))}.ran-input[disabled]>.ran-input-label{color:var(--ran-input-label-disabled-color, var(--ran-color-text-disabled, #999));border-color:var(--ran-input-label-disabled-border-color, var(--ran-color-border, #eaeaea));box-shadow:var(--ran-input-label-disabled-box-shadow, none);cursor:var(--ran-input-label-disabled-cursor, not-allowed)}.ran-input-content{writing-mode:var(--ran-input-content-writing-mode, horizontal-tb);text-rendering:var(--ran-input-content-text-rendering, auto);letter-spacing:var(--ran-input-content-letter-spacing, normal);word-spacing:var(--ran-input-content-word-spacing, normal);text-transform:var(--ran-input-content-text-transform, none);text-indent:var(--ran-input-content-text-indent, 0px);text-shadow:var(--ran-input-content-text-shadow, none);text-align:var(--ran-input-content-text-align, start);cursor:var(--ran-input-content-cursor, text);touch-action:var(--ran-input-content-touch-action, manipulation);-webkit-appearance:var(--ran-input-content--webkit-appearance, none);text-overflow:var(--ran-input-content-text-overflow, ellipsis);box-sizing:var(--ran-input-content-box-sizing, border-box);margin:var(--ran-input-content-margin, 0);font-variant:var(--ran-input-content-font-variant, tabular-nums);list-style:var(--ran-input-content-list-style, none);font-feature-settings:var(--ran-input-content-font-feature-settings, "tnum");position:var(--ran-input-content-position, relative);border:var(--ran-input-content-border, none);width:var(--ran-input-content-width, 100%);height:var(--ran-input-content-height, 100%);min-height:var(--ran-input-content-min-height, 30px);min-width:var(--ran-input-content-min-width, 0);color:var(--ran-input-content-color, var(--ran-color-text, #000000d9));font-size:var(--ran-input-content-font-size, 14px);line-height:var(--ran-input-content-line-height, 1.48);background-color:var(--ran-input-content-background-color, var(--ran-color-bg-elevated, #fff));background-image:var(--ran-input-content-background-image, none);transition:var(--ran-input-content-transition, none);outline:var(--ran-input-content-outline, none);border-radius:var(--ran-input-content-border-radius, var(--ran-radius-sm, 6px));padding:var(--ran-input-content-padding, 0 0 0 2px);font-weight:var(--ran-input-content-font-weight, 400)}.ran-input-content:focus,.ran-input-content:hover{border:var(--ran-input-content-hover-border, none);outline:var(--ran-input-content-hover-outline, 0)}.ran-input-content::placeholder{color:var(--ran-input-content-placeholder-color, var(--ran-color-text-disabled, #999))}.ran-input-content:placeholder-shown~.ran-input-label{transform:var(--ran-input-content-placeholder-label-transform, translateY( calc(-50% - .43em) ) scale(.8))}.ran-input-content:focus~.ran-input-label{transform:var(--ran-input-content-focus-label-transform, translateY( calc(-50% - .43em) ) scale(.8));top:var(--ran-input-content-focus-label-top, 0px)}.ran-input-content::-webkit-search-cancel-button{display:none;-webkit-appearance:none}.ran-input-label{box-sizing:var(--ran-input-label-box-sizing, border-box);pointer-events:var(--ran-input-label-pointer-events, none);position:var(--ran-input-label-position, absolute);font-size:var(--ran-input-label-font-size, 14px);left:var(--ran-input-label-left, 8px);transition:var(--ran-input-label-transition, transform .3s, top .3s, font-size .3s);transform-origin:var(--ran-input-label-transform-origin, left);padding:var(--ran-input-label-padding, 0 0);color:var(--ran-input-label-color, var(--ran-color-text-disabled, #999));background:var(--ran-input-label-background, var(--ran-color-bg-elevated, #fff));opacity:var(--ran-input-label-opacity, .9)}.ran-input-message{margin-top:var(--ran-input-message-margin-top, 4px);font-size:var(--ran-input-message-font-size, 12px);line-height:var(--ran-input-message-line-height, 1.5);color:var(--ran-input-message-color, var(--ran-color-text-secondary, #8c8c8c))}.ran-input-message:empty{display:none}:host([status="error"]) .ran-input-message{color:var(--ran-input-message-error-color, var(--ran-color-danger, #ff4d4f))}:host([status="warning"]) .ran-input-message{color:var(--ran-input-message-warning-color, var(--ran-color-warning, #faad14))}`,jh=0,_s=class extends ct{static formAssociated=!0;_internals;static get observedAttributes(){return["label","disabled","name","placeholder","type","icon","value","status","message","min","max","step","required","sheet"]}_events=new xt;_shadowDom;_input;_label;_inputContent;_icon;_message;constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=void 0}this._shadowDom=ht(this,Jh);const r=gt(this._shadowDom,".ran-input",()=>x().class("ran-input").part("input").children(Za().class("ran-input-content").part("content")).build());this._input=r,this._inputContent=r.querySelector(".ran-input-content"),this._inputContent.id||(this._inputContent.id=`ran-input-${++jh}`)}get value(){return this.getAttribute("value")||""}set value(r){!yt(this)&&r?(this.setAttribute("value",r),this._input.setAttribute("value",r)):(this.removeAttribute("value"),this._input.removeAttribute("value")),this._internals?.setFormValue?.(this.getAttribute("value")??"")}get placeholder(){return this.getAttribute("placeholder")||""}set placeholder(r){r?this.setAttribute("placeholder",r):this.removeAttribute("placeholder")}get required(){return this.hasAttribute("required")}set required(r){!r||r==="false"?this.removeAttribute("required"):this.setAttribute("required","")}get disabled(){return yt(this)}set disabled(r){ce.includes(r)?(this.removeAttribute("disabled"),this._input.removeAttribute("disabled"),this._inputContent.removeAttribute("disabled")):(this.setAttribute("disabled",""),this._input.setAttribute("disabled",""),this._inputContent.setAttribute("disabled",""))}get label(){return this.getAttribute("label")||""}set label(r){this.setAttribute("label",r)}get status(){return this.getAttribute("status")||""}set status(r){r?(this.setAttribute("status",r),this._input.setAttribute("status",r)):(this.removeAttribute("status"),this._input.removeAttribute("status"))}get message(){return this.getAttribute("message")||""}set message(r){r?this.setAttribute("message",r):this.removeAttribute("message")}get name(){return this.getAttribute("name")||""}set name(r){this.setAttribute("name",r)}get min(){return this.getAttribute("min")||""}set min(r){this.type==="number"&&this.setAttribute("min",r)}get max(){return this.getAttribute("max")||""}set max(r){this.type==="number"&&this.setAttribute("max",r)}get step(){return this.getAttribute("step")||""}set step(r){this.type==="number"&&this.setAttribute("step",r)}get icon(){return this.getAttribute("icon")||""}set icon(r){r?this.setAttribute("icon",r):this.removeAttribute("icon")}get type(){return this.getAttribute("type")||""}set type(r){r?this.setAttribute("type",r):this.removeAttribute("type")}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};customInput=r=>{r.stopPropagation(),r.preventDefault();const{target:c,data:g=""}=r;this.value=c?.value||g||"",this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value}}))};customChange=()=>{this.value=this._inputContent?.value??this.value,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value}}))};listenPlaceholder=(r,c)=>{r==="placeholder"&&this._inputContent&&(c!=null?this._inputContent.setAttribute("placeholder",c):this._inputContent.removeAttribute("placeholder"))};listenLabel=(r,c)=>{r==="label"&&this._inputContent&&(c!=null?this._label?this._label.innerHTML=c:(this._label=ah().class("ran-input-label").part("label").text(c).build(),this._label.htmlFor=this._inputContent.id,this._input.appendChild(this._label)):(this._input.removeAttribute("label"),this._label&&(this._input.removeChild(this._label),this._label=void 0)))};listenType=(r,c)=>{r==="type"&&this._inputContent&&(c?this._inputContent.setAttribute("type",c):(this._inputContent.removeAttribute("type"),this._inputContent.removeAttribute("min"),this._inputContent.removeAttribute("max"),this._inputContent.removeAttribute("step")))};listenStatus=(r,c)=>{r==="status"&&this._input&&(c?this._input.setAttribute("status",c):this._input.removeAttribute("status"))};listenMessage=(r,c)=>{r==="message"&&(c?(this._message||(this._message=x().class("ran-input-message").part("message").build(),this._shadowDom.appendChild(this._message)),this._message.textContent=c):this._message&&(this._message.remove(),this._message=void 0))};listenNumericConstraint=(r,c)=>{(r==="min"||r==="max"||r==="step")&&this._inputContent&&(this.type==="number"&&c!=null?this._inputContent.setAttribute(r,c):this._inputContent.removeAttribute(r))};listenRequired=(r,c)=>{r==="required"&&this._inputContent&&(c!=null?this._inputContent.setAttribute("required",""):this._inputContent.removeAttribute("required"))};listenDisabled=(r,c)=>{r==="disabled"&&this._input&&(ce.includes(c)?this._input.removeAttribute("disabled"):(this._input.setAttribute("disabled",""),this._inputContent.setAttribute("disabled","")))};listenIcon=(r,c,g)=>{r==="icon"&&c&&c!==g&&(this.removeAttribute("label"),this.setAttribute("icon",c),this.dealIcon())};dealIcon=()=>{this._icon||(this._icon=rt("r-icon").class("ran-icon").build(),this._inputContent.insertAdjacentElement("beforebegin",this._icon)),this.icon&&this._icon.setAttribute("name",this.icon)};listenEvent=(r,c,g)=>{this.listenPlaceholder(r,g),this.listenLabel(r,g),this.listenStatus(r,g),this.listenMessage(r,g),this.listenNumericConstraint(r,g),this.listenRequired(r,g),this.listenDisabled(r,g),this.listenIcon(r,g,c),r==="value"&&c!==g&&(this._inputContent.value=g,this._input.setAttribute("value",g))};connectedCallback(){this.handlerExternalCss(),this.value&&(this._inputContent.value=this.value,this._input.setAttribute("value",this.value)),this._internals?.setFormValue?.(this.value),this.status&&this._input.setAttribute("status",this.status),this.message&&this.listenMessage("message",this.message),yt(this)&&(this._input.setAttribute("disabled",""),this._inputContent.setAttribute("disabled","")),this.type&&this._inputContent.setAttribute("type",this.type),this.type==="number"&&(this.min&&this._inputContent.setAttribute("min",this.min),this.max&&this._inputContent.setAttribute("max",this.max),this.step&&this._inputContent.setAttribute("step",this.step)),this.required&&this._inputContent.setAttribute("required",""),this._events.on(this._inputContent,"input",this.customInput),this._events.on(this._inputContent,"change",this.customChange),document.readyState==="complete"&&this.dealIcon()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(r,c,g){c!==g&&(this.listenEvent(r,c,g),r==="sheet"&&this.handlerExternalCss())}};dt("r-input",_s);var $h='.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host([type="toast"]) .ran-message-notice{padding:8px;text-align:center;max-width:90%;margin:0 auto;word-break:break-all}:host([type="toast"]) .ran-message-notice-content{display:inline-block;padding:10px 16px;background:#000000b3;border-radius:7px;pointer-events:all}:host([type="toast"]) .ran-message-notice-content-info{align-items:center;display:flex}:host([type="toast"]) .ran-message-notice-content-info span{margin:0;padding:0;font-size:14px;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";z-index:1010;width:100%;pointer-events:none;color:#fff}.ran-message-notice{padding:var(--ran-message-notice-padding, 8px);text-align:var(--ran-message-notice-text-align, center);max-width:var(--ran-message-notice-max-width, 90%);margin:var(--ran-message-notice-margin, 0 auto);word-break:var(--ran-message-notice-word-break, break-all)}.ran-message-notice-content{display:var(--ran-message-notice-content-display, inline-block);padding:var(--ran-message-notice-content-padding, 10px 16px);background:var(--ran-message-notice-content-background, var(--ran-color-bg-elevated, #fff));border-image-source:var(--ran-message-notice-content-border-image-source, none);border-image-slice:var(--ran-message-notice-content-border-image-slice, 8);border-image-width:var(--ran-message-notice-content-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-message-notice-content-border-radius, var(--ran-radius-md, 12px));box-shadow:var(--ran-message-notice-content-box-shadow, var(--ran-shadow-menu, 0 2px 4px #0000000d, 0 8px 24px -6px #00000024));pointer-events:var(--ran-message-notice-content-pointer-events, all)}.ran-message-notice-content-info{align-items:var(--ran-message-notice-content-info-align-items, center);display:var(--ran-message-notice-content-info-display, flex)}.ran-message-notice-content-info span{margin:var(--ran-message-notice-content-info-span-margin, 0);padding:var(--ran-message-notice-content-info-span-padding, 0);color:var(--ran-message-notice-content-info-span-color, var(--ran-color-text, #000000d9));font-size:var(--ran-message-notice-content-info-span-font-size, 14px);font-variant:var(--ran-message-notice-content-info-span-font-variant, tabular-nums);list-style:var(--ran-message-notice-content-info-span-list-style, none);font-feature-settings:var(--ran-message-notice-content-info-span-font-feature-settings, "tnum");z-index:var(--ran-message-notice-content-info-span-z-index, 1010);width:var(--ran-message-notice-content-info-span-width, 100%);pointer-events:var(--ran-message-notice-content-info-span-pointer-events, none)}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes MessageMoveIn{0%{padding:0;transform:translateY(-100%);opacity:0}to{padding:8px;transform:translateY(0);opacity:1}}@keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}.ranui-message{box-sizing:var(--ran-message-box-sizing, border-box);margin:var(--ran-message-margin, 0);padding:var(--ran-message-padding, 0);color:var(--ran-message-color, var(--ran-color-text, #000000d9));font-size:var(--ran-message-font-size, 14px);font-variant:var(--ran-message-font-variant, tabular-nums);line-height:var(--ran-message-line-height, 1.5715);list-style:var(--ran-message-ist-style, none);font-feature-settings:var(--ran-message-font-feature-settings, "tnum");position:var(--ran-message-position, fixed);top:var(--ran-message-top, 8px);left:var(--ran-message-left, 0);z-index:var(--ran-message-z-index, var(--ran-z-message, 1200));width:var(--ran-message-width, 100%);pointer-events:var(--ran-message-pointer-events, none)}.ranui-message .message-in{animation-name:var(--ran-message-in-animation-name, MessageMoveIn);animation-duration:var(--ran-message-in-animation-duration, .3s);animation-timing-function:var(--ran-message-in-animation-timing-function, cubic-bezier(.78, .14, .15, .86))}.ranui-message .message-leave{animation-name:var(--ran-message-leave-animation-name, MessageMoveOut);animation-duration:var(--ran-message-leave-animation-duration, .3s);animation-timing-function:var(--ran-message-leave-animation-timing-function, cubic-bezier(.78, .14, .15, .86))}',Ws="data-ranui-message-host",tu=()=>`[${Ws}="true"]`,eu=(r,c)=>{const g=c?.top??8,A=c?.zIndex??1200;r.style.setProperty("position","fixed"),r.style.setProperty("top",typeof g=="number"?`${g}px`:String(g)),r.style.setProperty("left","0"),r.style.setProperty("width","100%"),r.style.setProperty("z-index",String(A)),r.style.setProperty("pointer-events","none")},ru=r=>typeof document>"u"?null:r?.getContainer?.()||document.body,iu=r=>{if(typeof document>"u")return null;const c=ru(r)||document.body;let g=c.querySelector(tu());return g||(g=x().attr(Ws,"true").children(x().class("ranui-message").attr("aria-live","polite").attr("aria-atomic","false")).build(),c.appendChild(g)),eu(g,r),g.querySelector(".ranui-message")},ts=300,es=3e3;yi({"check-circle-fill":Ys,"close-circle-fill":Gs,"info-circle-fill":zs,"warning-circle-fill":Vs});var au=new Map([["success","check-circle-fill"],["warning","warning-circle-fill"],["error","close-circle-fill"],["info","info-circle-fill"],["toast",null]]),nu=new Map([["success","#52c41a"],["warning","#faad14"],["error","#ff4d4f"],["info","#006bff"],["toast","rgba(0, 0, 0, 0.7)"]]),Xs=class extends ct{_info;_notice;_content;_icon;_span;_shadowDom;timeId;close;static get observedAttributes(){return["type","content","sheet"]}constructor(){super(),this._shadowDom=ht(this,$h);const r=gt(this._shadowDom,".ran-message-notice",()=>x().class("ran-message-notice").children(x().class("ran-message-notice-content").children(x().class("ran-message-notice-content-info").children(rt("r-icon"),ke()))).build());this._notice=r,this._content=r.querySelector(".ran-message-notice-content"),this._info=r.querySelector(".ran-message-notice-content-info"),this._icon=r.querySelector("r-icon"),this._span=r.querySelector("span"),this.handlerExternalCss()}connectedCallback(){ct.prototype.connectedCallback?.call(this),this.hasAttribute("aria-atomic")||this.setAttribute("aria-atomic","true")}get type(){return this.getAttribute("type")}set type(r){r&&this.setAttribute("type",r)}get content(){return this.getAttribute("content")}set content(r){r&&this.setAttribute("content",r)}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};setA11yRole=r=>{const c=r==="error"||r==="warning";this.setAttribute("role",c?"alert":"status")};setIcon=r=>{const c=au.get(r),g=nu.get(r);c&&(this._icon?.setAttribute("name",c),this._icon?.style.setProperty("margin-right","8px"),this._icon?.setAttribute("size","18"),g&&this._icon?.setAttribute("color",g))};attributeChangedCallback(r,c,g){c!==g&&(r==="content"&&(this._span.textContent=g),r==="type"&&(this.setIcon(g),this.setA11yRole(g)),r==="sheet"&&this.handlerExternalCss())}};dt("r-message",Xs);function ou(){if(typeof window>"u")return null;const r=g=>A=>{const k={},B=rt("r-message").class("message").build();B.timeId&&clearTimeout(B.timeId),B.setAttribute("type",g);let D=es,O;if(!A)return;typeof A=="string"?B.setAttribute("content",A):(B.setAttribute("content",A.content),O=A.close,D=A.duration||es,k.top=A.top,k.zIndex=A.zIndex,k.getContainer=A.getContainer);const Y=iu(k);if(!Y)return;const X=setTimeout(()=>{B.classList.remove("message-in"),B.classList.add("message-leave"),clearTimeout(X)},D-ts);B.timeId=setTimeout(()=>{B.classList.remove("message-leave"),Y.removeChild(B),O&&O()},D),Y.appendChild(B),B.classList.add("message-in"),setTimeout(()=>{B.classList.remove("message-in")},ts)},c={info:r("info"),success:r("success"),error:r("error"),warning:r("warning"),toast:r("toast")};return window.message=c,window.ranui||(window.ranui={}),window.ranui.message=c,c}var Xg=ou(),su='.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}@keyframes skeleton{0%{transform:translate(-37.5%)}to{transform:translate(37.5%)}}.ran-skeleton{position:relative;z-index:0;overflow:hidden;background:0 0;width:100%;height:var(--ran-skeleton-height, 16px);background:var(--ran-skeleton-background, var(--ran-gray-alpha-200, rgba(0, 0, 0, .06)));border-radius:var(--ran-skeleton-border-radius, var(--ran-radius-sm, 6px))}.ran-skeleton:after{position:absolute;top:0;inset-inline-end:-150%;bottom:0;inset-inline-start:-150%;background:var(--ran-skeleton-shimmer, linear-gradient(90deg, var(--ran-gray-alpha-200, rgba(0, 0, 0, .06)) 25%, var(--ran-gray-alpha-500, rgba(0, 0, 0, .15)) 37%, var(--ran-gray-alpha-200, rgba(0, 0, 0, .06)) 63%));animation-name:skeleton;animation-duration:var(--ran-skeleton-animation-duration, 1.4s);animation-timing-function:ease;animation-iteration-count:infinite;content:""}',Zs=class extends ct{_div;_shadowDom;static get observedAttributes(){return["sheet"]}constructor(){super(),this._shadowDom=ht(this,su),this._div=gt(this._shadowDom,".ran-skeleton",()=>x().class("ran-skeleton").build())}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};connectedCallback(){this.handlerExternalCss()}attributeChangedCallback(r,c,g){c!==g&&r==="sheet"&&this.handlerExternalCss()}};dt("r-skeleton",Zs);var lu=".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}",Js=class extends ct{static get observedAttributes(){return["label","key","disabled","icon","effect","iconSize","sheet"]}_events=new xt;_div;parent;_shadowDom;constructor(){super(),this._shadowDom=ht(this,lu);const r=gt(this._shadowDom,"slot",()=>Bt().part("content").build());this._div=r}get label(){return this.getAttribute("label")||""}set label(r){this.setAttribute("label",r)}get icon(){return this.getAttribute("icon")}set icon(r){!r||r==="false"?this.removeAttribute("icon"):this.setAttribute("icon",r)}get iconSize(){return this.getAttribute("iconSize")}set iconSize(r){!r||r==="false"?this.removeAttribute("iconSize"):this.setAttribute("iconSize",r)}get key(){return this.getAttribute("r-key")}set key(r){r?this.setAttribute("r-key",r):this.removeAttribute("r-key")}get disabled(){return this.getAttribute("disabled")}set disabled(r){!r||r==="false"?this.removeAttribute("disabled"):this.setAttribute("disabled",r)}get effect(){return this.getAttribute("effect")}set effect(r){!r||r==="false"?this.removeAttribute("effect"):this.setAttribute("effect",r)}get sheet(){return this.getAttribute("sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};initAttribute=()=>{this.parent=this.parentNode,this.key&&(this.parent?.updateAttribute(this.key,"icon",this.icon),this.parent?.updateAttribute(this.key,"iconSize",this.iconSize),this.parent?.updateAttribute(this.key,"effect",this.effect))};connectedCallback(){this.handlerExternalCss(),this._events.on(document,"DOMContentLoaded",this.initAttribute)}disconnectedCallback(){this._events.abort()}attributeChangedCallback(r,c,g){c!==g&&(this.key&&this.parent?.updateAttribute&&(r==="icon"&&this.parent?.updateAttribute(this.key,"icon",g),r==="iconSize"&&this.parent?.updateAttribute(this.key,"iconSize",g),r==="effect"&&this.parent?.updateAttribute(this.key,"effect",g),r==="disabled"&&this.parent?.updateAttribute(this.key,"disabled",g)),r==="sheet"&&this.handlerExternalCss())}};dt("r-tab",Js);var cu='.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-tab ::slotted(r-tab){box-sizing:border-box;width:100%;height:100%;padding:10px;flex-shrink:0;overflow:auto;text-align:start}.ran-tab-header{position:relative;overflow:hidden;scroll-behavior:smooth}.ran-tab-header-nav{display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:center}.ran-tab-header-nav::-webkit-scrollbar{display:none}.ran-tab-header-nav-item{flex-shrink:0}.ran-tab-header-nav .active{color:var(--ran-tab-active-color, var(--ran-color-primary, #006bff))}.ran-tab-header-line{position:absolute;width:0;margin-top:-2px;height:2px;border-radius:2px;background:var(--ran-tab-line-color, var(--ran-color-primary, #006bff));transition:var(--ran-tab-line-transition, left .2s, width .2s, transform .2s)}.ran-tab-content{overflow:hidden}.ran-tab-content-wrap{display:flex;width:100%;height:100%;transition:var(--ran-tab-content-transition, transform .2s)}:host([type="line"]) .ran-tab-header-nav-item{border:solid 1px transparent}:host([type="line"]) .ran-tab-header-nav .active{color:var(--ran-tab-line-color, var(--ran-color-primary, #006bff));border:solid 1px transparent;border-color:var(--ran-tab-border-color, var(--ran-color-border, rgba(0, 0, 0, .2))) var(--ran-tab-border-color, var(--ran-color-border, rgba(0, 0, 0, .2))) transparent;border-radius:var(--ran-tab-border-radius, var(--ran-radius-sm, .25em)) var(--ran-tab-border-radius, var(--ran-radius-sm, .25em)) 0 0}:host([type="line"]) .ran-tab-header-line{transition:none;visibility:hidden}:host([type="line"]) .ran-tab-header-line:after,:host([type="line"]) .ran-tab-header-line:before{content:"";position:absolute;visibility:visible;width:9999px;height:1px;bottom:0;background:var(--ran-tab-border-color, var(--ran-color-border, rgba(0, 0, 0, .2)))}:host([type="line"]) .ran-tab-header-line:after{left:100%}:host([type="line"]) .ran-tab-header-line:before{right:100%}:host([align="center"]) .ran-tab-header-nav{justify-content:center}:host([align="center"]) .ran-tab-header-line{left:50%}:host([align="end"]) .ran-tab-header-nav{justify-content:flex-end}',du=0,js=class extends ct{static get observedAttributes(){return["active","type","align","effect","sheet"]}_events=new xt;_container;_header;_nav;_line;_content;_wrap;_slot;_shadowDom;_tabsId;tabHeaderKeyMapIndex;constructor(){super(),this._tabsId=++du,this._shadowDom=ht(this,cu),this.tabHeaderKeyMapIndex={};const r=gt(this._shadowDom,".ran-tab",()=>x().class("ran-tab").part("tabs").children(x().class("ran-tab-header").part("header").children(x().class("ran-tab-header-nav").part("nav"),x().class("ran-tab-header-line").part("indicator")),x().class("ran-tab-content").part("content").children(x().class("ran-tab-content-wrap").part("content-wrap").children(Bt()))).build());this._container=r,this._header=r.querySelector(".ran-tab-header"),this._nav=r.querySelector(".ran-tab-header-nav"),this._line=r.querySelector(".ran-tab-header-line"),this._content=r.querySelector(".ran-tab-content"),this._wrap=r.querySelector(".ran-tab-content-wrap"),this._slot=r.querySelector("slot"),this._nav.setAttribute("role","tablist")}get align(){return _(this,"align","start")}set align(r){this.setAttribute("align",r)}get type(){return _(this,"type","flat")}set type(r){this.setAttribute("type",r)}get active(){return this.getAttribute("active")}set active(r){r?(this.setAttribute("active",r),this.setTabLine(r),this.setTabContent(r),this.syncTabsAria()):this.removeAttribute("active")}get effect(){return this.getAttribute("effect")}set effect(r){!r||r==="false"?this.removeAttribute("effect"):this.setAttribute("effect",r)}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};initTabHeaderKeyMapIndex=(r,c)=>{if(this.tabHeaderKeyMapIndex[r])throw new Error("tab 组件的 key 值存在重复,或者某个 tab 组件缺少 key 属性");this.tabHeaderKeyMapIndex[r]=c};createTabHeader(r,c){const g=r.getAttribute("label")||"",A=r.getAttribute("icon")||"",k=r.getAttribute("iconSize")||"",B=r.getAttribute("r-key")||`${c}`,D=r.getAttribute("type")||"text";this.initTabHeaderKeyMapIndex(B,c);const O=rt("r-button").class("tab-header-nav-item").attr("type",D).attr("r-key",B).text(g);return A&&O.attr("icon",A),k&&O.attr("iconSize",k),yt(r)&&O.attr("disabled",""),this.effect&&(r.setAttribute("effect",this.effect),this._line.style.setProperty("display","none")),r.setAttribute("r-key",B),O.build()}initTabLineAlignCenter=()=>{const{length:r}=this._nav.children;let c=0;for(let g=0;g<r;g++){const{width:A=0}=this._nav.children[g].getBoundingClientRect();c+=A}this._line.style.setProperty("left",`calc(50% - ${c/2}px)`)};initTabLineAlignEnd=()=>{const{length:r}=this._nav.children;let c=0;for(let g=0;g<r;g++){const{width:A=0}=this._nav.children[g].getBoundingClientRect();c+=A}this._line.style.setProperty("left",`calc(100% - ${c}px)`)};setTabLine=r=>{if(r){const c=this.tabHeaderKeyMapIndex[r],{width:g=0}=this._nav.children[c].getBoundingClientRect();this._line.style.setProperty("width",`${g}px`);let A=0;for(let k=0;k<c;k++){const{width:B=0}=this._nav.children[k].getBoundingClientRect();A+=B}this._line.style.setProperty("transform",`translateX(${A}px)`)}};setTabContent=r=>{if(r){const c=this.tabHeaderKeyMapIndex[r];this._wrap.style.setProperty("transform",`translateX(${c*-100}%)`)}};clickTabHead=r=>{const c=r.currentTarget??r.target,g=c.getAttribute("r-key");!yt(c)&&g&&this.activateKey(g)};activateKey=r=>{this.setAttribute("active",r),this.setTabLine(r),this.setTabContent(r),this._nav.querySelectorAll(".active").forEach(g=>g.classList.remove("active"));const c=this.tabHeaderKeyMapIndex[r];this._nav.children[c]?.classList.add("active"),this.syncTabsAria()};tabFocusable=r=>r._btn??r;tabIdFor=r=>`ran-tab-${this._tabsId}-${r}`;panelIdFor=r=>`ran-tabpanel-${this._tabsId}-${r}`;syncTabsAria=()=>{const r=this.active,c=this._slot?.assignedElements?.()??[];[...this._nav.children].forEach((g,A)=>{const k=g.getAttribute("r-key")??`${A}`,B=k===r,D=yt(g),O=this.tabFocusable(g);O.setAttribute("role","tab"),O.id=this.tabIdFor(k),O.setAttribute("aria-controls",this.panelIdFor(k)),O.setAttribute("aria-selected",B?"true":"false"),O.tabIndex=B&&!D?0:-1;const Y=c[A];Y&&(Y.setAttribute("role","tabpanel"),Y.id=this.panelIdFor(k),Y.setAttribute("aria-labelledby",this.tabIdFor(k)),Y.setAttribute("tabindex",B?"0":"-1"),B?Y.removeAttribute("aria-hidden"):Y.setAttribute("aria-hidden","true"))})};onNavKeydown=r=>{if(!["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(r.key))return;const c=[...this._nav.children].filter(D=>!yt(D));if(!c.length)return;const g=r.target?.closest?.(".tab-header-nav-item")??r.target;let A=c.findIndex(D=>D===g);A<0&&(A=c.findIndex(D=>D.getAttribute("r-key")===this.active)),A<0&&(A=0);let k=A;r.key==="ArrowRight"||r.key==="ArrowDown"?k=(A+1)%c.length:r.key==="ArrowLeft"||r.key==="ArrowUp"?k=(A-1+c.length)%c.length:r.key==="Home"?k=0:r.key==="End"&&(k=c.length-1),r.preventDefault();const B=c[k].getAttribute("r-key");B&&(this.activateKey(B),this.tabFocusable(c[k]).focus())};updateAttribute=(r,c,g="")=>{const A=this.tabHeaderKeyMapIndex[r];r&&g&&this._nav.children[A]?this._nav.children[A]?.setAttribute(c,g):this._nav.children[A]?.removeAttribute(c)};initActive=()=>{const r=[...this._nav.children],c=r.filter(B=>!yt(B));let g;if(this.active!=null&&(g=c.find(B=>B.getAttribute("r-key")===this.active),g?.setAttribute("r-key",this.active)),g||(g=c.shift()),!g)return;const A=r.findIndex(B=>B===g),k=g?.getAttribute("r-key")||`${A}`;k!=null&&(this.setAttribute("active",`${k}`),g.classList.add("active"),this.setTabContent(k),setTimeout(()=>{this.setTabLine(k)},200))};listenSlotChange=()=>{this._slot.assignedElements().forEach((r,c)=>{const g=this.createTabHeader(r,c);this._nav.appendChild(g),g.addEventListener("click",this.clickTabHead)}),this.initActive(),this.syncTabsAria(),this.align&&(this.align==="center"&&this.initTabLineAlignCenter(),this.align==="end"&&this.initTabLineAlignEnd())};connectedCallback(){this.handlerExternalCss(),this._events.on(this._slot,"slotchange",this.listenSlotChange),this._events.on(this._nav,"keydown",this.onNavKeydown)}disconnectedCallback(){this._events.abort()}attributeChangedCallback(r,c,g){c!==g&&(this.dispatchEvent(new CustomEvent("change",{detail:{active:this.active}})),r==="align"&&(g==="center"&&this.initTabLineAlignCenter(),g==="end"&&this.initTabLineAlignEnd()),r==="effect"&&[...this._nav.children].forEach(A=>{!this.effect||this.effect==="false"?A.removeAttribute("effect"):A.setAttribute("effect",g)}),r==="active"&&this.setAttribute(r,g),r==="sheet"&&this.handlerExternalCss())}};dt("r-tabs",js);var hu=".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{--ran-radar-polygon-color: var(--ran-color-border, #e6e6e6);--ran-radar-line-color: var(--ran-color-border, #e6e6e6);--ran-radar-fill-color: rgba(255, 121, 35, .6);--ran-radar-stroke-color: rgba(255, 121, 35, .6)}.ran-radar{position:var(--ran-radar-position, relative);width:var(--ran-radar-width, 100%);height:var(--ran-radar-height, 100%);display:var(--ran-radar-display, block)}.ran-radar canvas{width:100%;height:100%}",uu="rgba(0,0,0,0)",gu="rgba(0,0,0,1)",rs="#e6e6e6",is="#e6e6e6",fu="黑体",as="rgba(255,121,35,0.60)",ns="rgba(255,121,35,0.60)",$s=class extends ct{mData;mCount;mW;mCenter;mRadius;mAngle;static get observedAttributes(){return["abilitys","colorpolygon","colorline","fillcolor","strokecolor","sheet"]}abilityRadarChartContainer;abilityRadarChart;_iconElement;_shadowDom;resizeObserver;constructor(){super(),this._shadowDom=ht(this,hu);const r=gt(this._shadowDom,".ran-radar",()=>x().class("ran-radar").children(rt("canvas").build()).build()),c=r.querySelector("canvas");this.abilityRadarChartContainer=r,this.abilityRadarChart=c,this.resizeObserver=new ResizeObserver(this.resize),this.resizeObserver.observe(this.abilityRadarChartContainer)}resize=()=>{this.refreshData()};get abilitys(){const r=this.getAttribute("abilitys");if(typeof r=="string")try{return JSON.parse(r)}catch(c){return console.error(`Failed to parse the rule in JSON.parse: ${r}, error: ${c}`),r}return r}set abilitys(r){typeof r=="string"?this.setAttribute("abilitys",r||""):this.setAttribute("abilitys",JSON.stringify(r)||"")}_cssVar(r){return typeof getComputedStyle>"u"?"":getComputedStyle(this).getPropertyValue(r).trim()}get colorPolygon(){return this.getAttribute("colorPolygon")||this._cssVar("--ran-radar-polygon-color")||rs}set colorPolygon(r){this.setAttribute("colorPolygon",r||rs)}get colorLine(){return this.getAttribute("colorLine")||this._cssVar("--ran-radar-line-color")||is}set colorLine(r){this.setAttribute("colorLine",r||is)}get fontColor(){return this._cssVar("--ran-color-text")||gu}get fillColor(){return this.getAttribute("fillColor")||this._cssVar("--ran-radar-fill-color")||as}set fillColor(r){this.setAttribute("fillColor",r||as)}get strokeColor(){return this.getAttribute("strokeColor")||this._cssVar("--ran-radar-stroke-color")||ns}set strokeColor(r){this.setAttribute("strokeColor",r||ns)}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};refreshData(){const r=this.abilityRadarChart.getContext("2d");if(!this.abilityRadarChartContainer||!r)return;const c=vr(r),g=this.abilityRadarChartContainer.clientWidth*c,A=this.abilityRadarChartContainer.clientHeight*c;this.abilityRadarChart.width=g,this.abilityRadarChart.height=A,this.mW=g,this.mData=this.abilitys,this.mCount=this.mData?.length||1,this.mCenter=this.mW/2,this.mRadius=this.mCenter-50*c,this.mAngle=Math.PI*2/this.mCount,this.drawPolygon(r),this.drawSide(r),this.drawLines(r),this.drawText(r),this.drawRegion(r),this.drawCircle(r)}drawSide(r){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)return;r.save(),r.strokeStyle=this.colorLine;const c=this.mRadius;for(let g=0;g<this.mCount;g++){const A=this.mCenter+c*Math.sin(this.mAngle*g),k=this.mCenter+c*Math.cos(this.mAngle*g);r.lineTo(A,k)}r.closePath(),r.stroke()}drawPolygon(r){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)return;r.save(),r.strokeStyle=this.colorPolygon;const c=this.mRadius/4;r.setLineDash([6,6]);for(let g=0;g<4;g++){r.beginPath();const A=c*(g+1);for(let k=0;k<this.mCount;k++){const B=this.mCenter+A*Math.sin(this.mAngle*k),D=this.mCenter+A*Math.cos(this.mAngle*k);r.lineTo(B,D)}r.closePath(),r.stroke()}r.restore()}drawLines(r){if(!(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)){r.save(),r.beginPath(),r.strokeStyle=this.colorLine;for(let c=0;c<this.mCount;c++){const g=this.mCenter+this.mRadius*Math.sin(this.mAngle*c),A=this.mCenter+this.mRadius*Math.cos(this.mAngle*c);r.moveTo(this.mCenter,this.mCenter),r.lineTo(g,A)}r.stroke(),r.restore()}}drawText(r){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;r.save();const c=vr(r),g=this.mCenter/12;for(let A=0;A<this.mCount;A++){const k=this.mCenter+this.mRadius*Math.sin(this.mAngle*A),B=this.mCenter+this.mRadius*Math.cos(this.mAngle*A),D=this.mData[A]?.backgroundColor||uu,O=this.mData[A]?.fontColor||this.fontColor,Y=this.mData[A]?.fontFamily||fu,X=this.mData[A]?.fontSize||g;r.font=`${X}px ${Y}`,this.mAngle*A>=0&&this.mAngle*A<Math.PI/2?this.drawButton(r,D,k,B,44*c,24*c,12*c,this.mData[A].abilityName,O,Y,X):this.mAngle*A>=Math.PI/2&&this.mAngle*A<Math.PI?this.drawButton(r,D,k,B-24*c,44*c,24*c,12*c,this.mData[A].abilityName,O,Y,X):this.mAngle*A>=Math.PI&&this.mAngle*A<Math.PI*3/2?this.drawButton(r,D,k-44*c,B-24*c,44*c,24*c,12*c,this.mData[A].abilityName,O,Y,X):this.drawButton(r,D,k-44*c,B,44*c,24*c,12*c,this.mData[A].abilityName,O,Y,X)}r.restore()}drawButton(r,c,g,A,k,B,D,O,Y,X,wt){r.beginPath();const pt=vr(r);r.fillStyle=c,r.moveTo(g+D,A),r.lineTo(g+k-D,A),r.arc(g+k-D,A+D,D,Math.PI*3/2,Math.PI*2),r.lineTo(g+k,A+B-D),r.arc(g+k-D,A+B-D,D,Math.PI,Math.PI/2),r.lineTo(g+D,A+B),r.arc(g+D,A+B-D,D,Math.PI/2,Math.PI),r.lineTo(g,A+D),r.arc(g+D,A+D,D,Math.PI,Math.PI*3/2),r.fill(),r.closePath(),r.beginPath(),r.fillStyle=Y,r.font=`${wt||12*pt}px ${X}`,r.textAlign="center",r.textBaseline="middle",r.fillText(O,g+k/2,A+B/2)}drawRegion(r){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;const c=vr(r);r.save(),r.beginPath();for(let g=0;g<this.mCount;g++){const A=this.mCenter+this.mRadius*Math.sin(this.mAngle*g)*this.mData[g].scoreRate/100,k=this.mCenter+this.mRadius*Math.cos(this.mAngle*g)*this.mData[g].scoreRate/100;r.lineTo(A,k)}r.closePath(),r.fillStyle=this.fillColor,r.fill(),r.strokeStyle=this.strokeColor,r.lineWidth=1*c,r.stroke(),r.restore()}drawCircle(r){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;const c=vr(r);r.save();for(let g=0;g<this.mCount;g++){const A=this.mCenter+this.mRadius*Math.sin(this.mAngle*g)*this.mData[g].scoreRate/100,k=this.mCenter+this.mRadius*Math.cos(this.mAngle*g)*this.mData[g].scoreRate/100;r.beginPath(),r.arc(A,k,3,0,Math.PI*2),r.lineWidth=1.5*c,r.strokeStyle=this.strokeColor,r.stroke()}r.restore()}connectedCallback(){this.handlerExternalCss(),this.refreshData()}disconnectedCallback(){this.resizeObserver.disconnect()}attributeChangedCallback(r,c,g){c!==g&&(["abilitys","colorpolygon","colorline","fillcolor","strokecolor"].includes(r)&&this.abilityRadarChartContainer&&this.refreshData(),r==="sheet"&&this.handlerExternalCss())}};dt("r-radar",$s);var pu=fs.__commonJSMin(((r,c)=>{(function g(A){var k=this,B=function(){"use strict";function D(s,n){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);n&&(e=e.filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable})),t.push.apply(t,e)}return t}function O(s){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?D(Object(t),!0).forEach(function(e){wt(s,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):D(Object(t)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(t,e))})}return s}function Y(s,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,kt(e.key),e)}}function X(s,n,t){return n&&Y(s.prototype,n),t&&Y(s,t),Object.defineProperty(s,"prototype",{writable:!1}),s}function wt(s,n,t){return(n=kt(n))in s?Object.defineProperty(s,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[n]=t,s}function pt(){return pt=Object.assign?Object.assign.bind():function(s){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s[e]=t[e])}return s},pt.apply(this,arguments)}function Et(s,n){s.prototype=Object.create(n.prototype),s.prototype.constructor=s,Ot(s,n)}function $t(s){return $t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$t(s)}function Ot(s,n){return Ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ot(s,n)}function mt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vt(s,n,t){return Vt=mt()?Reflect.construct.bind():function(e,i,a){var o=[null];o.push.apply(o,i);var l=new(Function.bind.apply(e,o));return a&&Ot(l,a.prototype),l},Vt.apply(null,arguments)}function Tt(s){var n=typeof Map=="function"?new Map:void 0;return Tt=function(t){if(t===null||(e=t,Function.toString.call(e).indexOf("[native code]")===-1))return t;var e;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(n!==void 0){if(n.has(t))return n.get(t);n.set(t,i)}function i(){return Vt(t,arguments,$t(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ot(i,t)},Tt(s)}function qt(s,n){(n==null||n>s.length)&&(n=s.length);for(var t=0,e=new Array(n);t<n;t++)e[t]=s[t];return e}function Pt(s,n){var t=typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(t)return(t=t.call(s)).next.bind(t);if(Array.isArray(s)||(t=(function(i,a){if(i){if(typeof i=="string")return qt(i,a);var o=Object.prototype.toString.call(i).slice(8,-1);return o==="Object"&&i.constructor&&(o=i.constructor.name),o==="Map"||o==="Set"?Array.from(i):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?qt(i,a):void 0}})(s))||n&&s&&typeof s.length=="number"){t&&(s=t);var e=0;return function(){return e>=s.length?{done:!0}:{done:!1,value:s[e++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
241
|
+
`,Zh=".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}",qs=class extends ct{static get observedAttributes(){return["src","fallback","sheet","alt"]}_image;_container;_shadowDom;constructor(){super(),this._shadowDom=ht(this,Zh);const r=gt(this._shadowDom,".ran-image",()=>x().class("ran-image").build());this._container=r}get fallback(){return _(this,"fallback",Xh)}set fallback(r){$(this,"fallback",r,{removeEmpty:!0})}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}get alt(){return _(this,"alt")}set alt(r){$(this,"alt",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};listenFallback(r,c){r==="fallback"&&this._image&&(c?this._image.setAttribute("fallback",c):this._image.removeAttribute("fallback"))}updateSrc=()=>{this._image&&(this._image.src=this.getAttribute("src")||"")};connectedCallback(){this.handlerExternalCss(),this._image=new Image,this._image.alt=this.alt,this._image.addEventListener("error",()=>{this._image&&this.fallback&&(this._image.src=this.fallback)}),this._image.addEventListener("load",()=>{this._image&&this._container.appendChild(this._image)}),this.updateSrc()}attributeChangedCallback(r,c,g){c!==g&&(this.listenFallback(r,g),r==="src"&&this.updateSrc(),r==="alt"&&this._image&&(this._image.alt=g??""),r==="sheet"&&this.handlerExternalCss())}};dt("r-img",qs);var Jh=`.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{position:var(--ran-input-host-position, relative);display:var(--ran-input-host-display, block);box-sizing:var(--ran-input-host-box-sizing, border-box)}:host([placeholder]) .ran-input-label{transform:var(--ran-input-label-placeholder-transform, translateY( calc(-50% - .43em) ) scale(.8));top:var(--ran-input-label-placeholder-top, 0)}:host .ran-input-label{transform:var(--ran-input-label-transform, translateY(-50%));top:var(--ran-input-label-top, 50%)}.ran-input{box-sizing:var(--ran-input-box-sizing, border-box);position:var(--ran-input-position, relative);display:var(--ran-input-display, flex);width:var(--ran-input-width, 100%);height:var(--ran-input-height, auto);min-width:var(--ran-input-min-width, 0);padding:var(--ran-input-padding, 0px 0px 0px 4px);color:var(--ran-input-color, var(--ran-color-text, #000000d9));font-size:var(--ran-input-font-size, 12px);font-family:var(--ran-input-font-family, var(--ran-skin-font-family, inherit));line-height:var(--ran-input-line-height, 1.5715);background-color:var(--ran-input-background-color, var(--ran-color-bg-elevated, #fff));background-image:var(--ran-input-background-image, none);border:var(--ran-input-border, 1px solid var(--ran-color-border, #eaeaea));border-image-source:var(--ran-input-border-image-source, none);border-image-slice:var(--ran-input-border-image-slice, 8);border-image-width:var(--ran-input-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-input-border-radius, var(--ran-radius-sm, 6px));transition:var(--ran-input-transition, none);min-height:var(--ran-input-min-height, 32px)}.ran-input .ran-icon{display:var(--ran-input-icon-display, flex);align-items:var(--ran-input-icon-align-items, center);justify-content:var(--ran-input-icon-justify-content, center)}.ran-input:focus-within{border-color:var(--ran-input-active-border-color, var(--ran-color-primary, #006bff));box-shadow:var(--ran-input-active-box-shadow, 0 0 0 2px var(--ran-blue-400, #cae7ff));border-right-width:var(--ran-input-active-border-right-width, 1px);outline:var(--ran-input-active-outline, 0)}.ran-input:hover{border-color:var(--ran-input-hover-border-color, var(--ran-color-primary, #006bff));border-right-width:var(--ran-input-hover-border-right-width, 1px)}.ran-input>.ran-input-content:hover~.ran-input-label{color:var(--ran-input-label-hover-color, var(--ran-color-primary, #006bff))}.ran-input[value]>.ran-input-label{transform:var(--ran-input-label-value-transform, translateY( calc(-50% - .43em) ) scale(.8));color:var(--ran-input-label-value-color, var(--ran-color-text-disabled, #00000040))}.ran-input[status=error] .ran-input-content,.ran-input[status=warning] .ran-input-content{padding-right:var(--ran-input-content-status-padding-right, 28px)}.ran-input[status=error]:after,.ran-input[status=warning]:after{content:"";position:absolute;top:50%;right:10px;width:16px;height:16px;transform:translateY(-50%);pointer-events:none;mask-position:center;mask-repeat:no-repeat;mask-size:contain;-webkit-mask-position:center;-webkit-mask-repeat:no-repeat;-webkit-mask-size:contain}.ran-input[status=error]{border-color:var(--ran-input-status-error-border-color, var(--ran-color-danger, #ff4d4f))}.ran-input[status=error]>.ran-input-content~.ran-input-label{color:var(--ran-input-label-status-error-color, var(--ran-color-danger, #ff4d4f))}.ran-input[status=error]:after{background-color:var(--ran-color-danger, #ff4d4f);mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.75 3.5h1.5v5h-1.5v-5zM8 11a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1a7 7 0 100 14A7 7 0 008 1zm-.75 3.5h1.5v5h-1.5v-5zM8 11a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E")}.ran-input[status=warning]{border-color:var(--ran-input-status-warning-border-color, var(--ran-color-warning, #faad14))}.ran-input[status=warning]>.ran-input-content~.ran-input-label{color:var(--ran-input-label-status-warning-color, var(--ran-color-warning, #faad14))}.ran-input[status=warning]:after{background-color:var(--ran-color-warning, #faad14);mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l6.85 11.86a.5.5 0 01-.43.75H1.58a.5.5 0 01-.43-.75L8 1.5zm-.75 4.25v3.5h1.5v-3.5h-1.5zM8 10.75a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5l6.85 11.86a.5.5 0 01-.43.75H1.58a.5.5 0 01-.43-.75L8 1.5zm-.75 4.25v3.5h1.5v-3.5h-1.5zM8 10.75a1 1 0 110 2 1 1 0 010-2z'/%3E%3C/svg%3E")}.ran-input[disabled]{color:var(--ran-input-disabled-color, var(--ran-color-text-disabled, #00000040));background-color:var(--ran-input-disabled-background-color, var(--ran-color-bg-muted, #f5f5f5));border-color:var(--ran-input-disabled-border-color, var(--ran-color-border, #eaeaea));box-shadow:var(--ran-input-disabled-box-shadow, none);cursor:var(--ran-input-disabled-cursor, not-allowed);opacity:var(--ran-input-disabled-opacity, 1)}.ran-input[disabled]>.ran-input-content{color:var(--ran-input-content-disabled-color, var(--ran-color-text-disabled, #00000040));background-color:var(--ran-input-content-disabled-background-color, var(--ran-color-bg-muted, #f5f5f5));border-color:var(--ran-input-content-disabled-border-color, var(--ran-color-border, #eaeaea));box-shadow:var(--ran-input-content-disabled-box-shadow, none);cursor:var(--ran-input-content-disabled-cursor, not-allowed);opacity:var(--ran-input-content-disabled-opacity, 1)}.ran-input[disabled]>.ran-input-content~.ran-input-label{color:var(--ran-input-label-disabled-color, var(--ran-color-text-disabled, #00000040));background-color:var(--ran-input-label-disabled-background-color, var(--ran-color-bg-muted, #f5f5f5))}.ran-input[disabled]>.ran-input-label{color:var(--ran-input-label-disabled-color, var(--ran-color-text-disabled, #999));border-color:var(--ran-input-label-disabled-border-color, var(--ran-color-border, #eaeaea));box-shadow:var(--ran-input-label-disabled-box-shadow, none);cursor:var(--ran-input-label-disabled-cursor, not-allowed)}.ran-input-content{writing-mode:var(--ran-input-content-writing-mode, horizontal-tb);text-rendering:var(--ran-input-content-text-rendering, auto);letter-spacing:var(--ran-input-content-letter-spacing, normal);word-spacing:var(--ran-input-content-word-spacing, normal);text-transform:var(--ran-input-content-text-transform, none);text-indent:var(--ran-input-content-text-indent, 0px);text-shadow:var(--ran-input-content-text-shadow, none);text-align:var(--ran-input-content-text-align, start);cursor:var(--ran-input-content-cursor, text);touch-action:var(--ran-input-content-touch-action, manipulation);-webkit-appearance:var(--ran-input-content--webkit-appearance, none);text-overflow:var(--ran-input-content-text-overflow, ellipsis);box-sizing:var(--ran-input-content-box-sizing, border-box);margin:var(--ran-input-content-margin, 0);font-variant:var(--ran-input-content-font-variant, tabular-nums);list-style:var(--ran-input-content-list-style, none);font-feature-settings:var(--ran-input-content-font-feature-settings, "tnum");position:var(--ran-input-content-position, relative);border:var(--ran-input-content-border, none);width:var(--ran-input-content-width, 100%);height:var(--ran-input-content-height, 100%);min-height:var(--ran-input-content-min-height, 30px);min-width:var(--ran-input-content-min-width, 0);color:var(--ran-input-content-color, var(--ran-color-text, #000000d9));font-size:var(--ran-input-content-font-size, 14px);line-height:var(--ran-input-content-line-height, 1.48);background-color:var(--ran-input-content-background-color, var(--ran-color-bg-elevated, #fff));background-image:var(--ran-input-content-background-image, none);transition:var(--ran-input-content-transition, none);outline:var(--ran-input-content-outline, none);border-radius:var(--ran-input-content-border-radius, var(--ran-radius-sm, 6px));padding:var(--ran-input-content-padding, 0 0 0 2px);font-weight:var(--ran-input-content-font-weight, 400)}.ran-input-content:focus,.ran-input-content:hover{border:var(--ran-input-content-hover-border, none);outline:var(--ran-input-content-hover-outline, 0)}.ran-input-content::placeholder{color:var(--ran-input-content-placeholder-color, var(--ran-color-text-disabled, #999))}.ran-input-content:placeholder-shown~.ran-input-label{transform:var(--ran-input-content-placeholder-label-transform, translateY( calc(-50% - .43em) ) scale(.8))}.ran-input-content:focus~.ran-input-label{transform:var(--ran-input-content-focus-label-transform, translateY( calc(-50% - .43em) ) scale(.8));top:var(--ran-input-content-focus-label-top, 0px)}.ran-input-content::-webkit-search-cancel-button{display:none;-webkit-appearance:none}.ran-input-label{box-sizing:var(--ran-input-label-box-sizing, border-box);pointer-events:var(--ran-input-label-pointer-events, none);position:var(--ran-input-label-position, absolute);font-size:var(--ran-input-label-font-size, 14px);left:var(--ran-input-label-left, 8px);transition:var(--ran-input-label-transition, transform .3s, top .3s, font-size .3s);transform-origin:var(--ran-input-label-transform-origin, left);padding:var(--ran-input-label-padding, 0 0);color:var(--ran-input-label-color, var(--ran-color-text-disabled, #999));background:var(--ran-input-label-background, var(--ran-color-bg-elevated, #fff));opacity:var(--ran-input-label-opacity, .9)}.ran-input-message{margin-top:var(--ran-input-message-margin-top, 4px);font-size:var(--ran-input-message-font-size, 12px);line-height:var(--ran-input-message-line-height, 1.5);color:var(--ran-input-message-color, var(--ran-color-text-secondary, #8c8c8c))}.ran-input-message:empty{display:none}:host([status="error"]) .ran-input-message{color:var(--ran-input-message-error-color, var(--ran-color-danger, #ff4d4f))}:host([status="warning"]) .ran-input-message{color:var(--ran-input-message-warning-color, var(--ran-color-warning, #faad14))}`,jh=0,_s=class extends ct{static formAssociated=!0;_internals;static get observedAttributes(){return["label","disabled","name","placeholder","type","icon","value","status","message","min","max","step","required","sheet"]}_events=new xt;_shadowDom;_input;_label;_inputContent;_icon;_message;constructor(){super();try{this._internals=this.attachInternals()}catch{this._internals=void 0}this._shadowDom=ht(this,Jh);const r=gt(this._shadowDom,".ran-input",()=>x().class("ran-input").part("input").children(Za().class("ran-input-content").part("content")).build());this._input=r,this._inputContent=r.querySelector(".ran-input-content"),this._inputContent.id||(this._inputContent.id=`ran-input-${++jh}`)}focus(r){this._inputContent?.focus(r)}blur(){this._inputContent?.blur()}select(){this._inputContent?.select?.()}get value(){return this.getAttribute("value")||""}set value(r){!yt(this)&&r?(this.setAttribute("value",r),this._input.setAttribute("value",r)):(this.removeAttribute("value"),this._input.removeAttribute("value")),this._internals?.setFormValue?.(this.getAttribute("value")??"")}get placeholder(){return this.getAttribute("placeholder")||""}set placeholder(r){r?this.setAttribute("placeholder",r):this.removeAttribute("placeholder")}get required(){return this.hasAttribute("required")}set required(r){!r||r==="false"?this.removeAttribute("required"):this.setAttribute("required","")}get disabled(){return yt(this)}set disabled(r){ce.includes(r)?(this.removeAttribute("disabled"),this._input.removeAttribute("disabled"),this._inputContent.removeAttribute("disabled")):(this.setAttribute("disabled",""),this._input.setAttribute("disabled",""),this._inputContent.setAttribute("disabled",""))}get label(){return this.getAttribute("label")||""}set label(r){this.setAttribute("label",r)}get status(){return this.getAttribute("status")||""}set status(r){r?(this.setAttribute("status",r),this._input.setAttribute("status",r)):(this.removeAttribute("status"),this._input.removeAttribute("status"))}get message(){return this.getAttribute("message")||""}set message(r){r?this.setAttribute("message",r):this.removeAttribute("message")}get name(){return this.getAttribute("name")||""}set name(r){this.setAttribute("name",r)}get min(){return this.getAttribute("min")||""}set min(r){this.type==="number"&&this.setAttribute("min",r)}get max(){return this.getAttribute("max")||""}set max(r){this.type==="number"&&this.setAttribute("max",r)}get step(){return this.getAttribute("step")||""}set step(r){this.type==="number"&&this.setAttribute("step",r)}get icon(){return this.getAttribute("icon")||""}set icon(r){r?this.setAttribute("icon",r):this.removeAttribute("icon")}get type(){return this.getAttribute("type")||""}set type(r){r?this.setAttribute("type",r):this.removeAttribute("type")}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};customInput=r=>{r.stopPropagation(),r.preventDefault();const{target:c,data:g=""}=r;this.value=c?.value||g||"",this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value}}))};customChange=()=>{this.value=this._inputContent?.value??this.value,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value}}))};listenPlaceholder=(r,c)=>{r==="placeholder"&&this._inputContent&&(c!=null?this._inputContent.setAttribute("placeholder",c):this._inputContent.removeAttribute("placeholder"))};listenLabel=(r,c)=>{r==="label"&&this._inputContent&&(c!=null?this._label?this._label.innerHTML=c:(this._label=ah().class("ran-input-label").part("label").text(c).build(),this._label.htmlFor=this._inputContent.id,this._input.appendChild(this._label)):(this._input.removeAttribute("label"),this._label&&(this._input.removeChild(this._label),this._label=void 0)))};listenType=(r,c)=>{r==="type"&&this._inputContent&&(c?this._inputContent.setAttribute("type",c):(this._inputContent.removeAttribute("type"),this._inputContent.removeAttribute("min"),this._inputContent.removeAttribute("max"),this._inputContent.removeAttribute("step")))};listenStatus=(r,c)=>{r==="status"&&this._input&&(c?this._input.setAttribute("status",c):this._input.removeAttribute("status"))};listenMessage=(r,c)=>{r==="message"&&(c?(this._message||(this._message=x().class("ran-input-message").part("message").build(),this._shadowDom.appendChild(this._message)),this._message.textContent=c):this._message&&(this._message.remove(),this._message=void 0))};listenNumericConstraint=(r,c)=>{(r==="min"||r==="max"||r==="step")&&this._inputContent&&(this.type==="number"&&c!=null?this._inputContent.setAttribute(r,c):this._inputContent.removeAttribute(r))};listenRequired=(r,c)=>{r==="required"&&this._inputContent&&(c!=null?this._inputContent.setAttribute("required",""):this._inputContent.removeAttribute("required"))};listenDisabled=(r,c)=>{r==="disabled"&&this._input&&(ce.includes(c)?this._input.removeAttribute("disabled"):(this._input.setAttribute("disabled",""),this._inputContent.setAttribute("disabled","")))};listenIcon=(r,c,g)=>{r==="icon"&&c&&c!==g&&(this.removeAttribute("label"),this.setAttribute("icon",c),this.dealIcon())};dealIcon=()=>{this._icon||(this._icon=rt("r-icon").class("ran-icon").build(),this._inputContent.insertAdjacentElement("beforebegin",this._icon)),this.icon&&this._icon.setAttribute("name",this.icon)};listenEvent=(r,c,g)=>{this.listenPlaceholder(r,g),this.listenLabel(r,g),this.listenStatus(r,g),this.listenMessage(r,g),this.listenNumericConstraint(r,g),this.listenRequired(r,g),this.listenDisabled(r,g),this.listenIcon(r,g,c),r==="value"&&c!==g&&(this._inputContent.value=g,this._input.setAttribute("value",g))};connectedCallback(){this.handlerExternalCss(),this.value&&(this._inputContent.value=this.value,this._input.setAttribute("value",this.value)),this._internals?.setFormValue?.(this.value),this.status&&this._input.setAttribute("status",this.status),this.message&&this.listenMessage("message",this.message),yt(this)&&(this._input.setAttribute("disabled",""),this._inputContent.setAttribute("disabled","")),this.type&&this._inputContent.setAttribute("type",this.type),this.type==="number"&&(this.min&&this._inputContent.setAttribute("min",this.min),this.max&&this._inputContent.setAttribute("max",this.max),this.step&&this._inputContent.setAttribute("step",this.step)),this.required&&this._inputContent.setAttribute("required",""),this._events.on(this._inputContent,"input",this.customInput),this._events.on(this._inputContent,"change",this.customChange),document.readyState==="complete"&&this.dealIcon()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(r,c,g){c!==g&&(this.listenEvent(r,c,g),r==="sheet"&&this.handlerExternalCss())}};dt("r-input",_s);var $h='.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host([type="toast"]) .ran-message-notice{padding:8px;text-align:center;max-width:90%;margin:0 auto;word-break:break-all}:host([type="toast"]) .ran-message-notice-content{display:inline-block;padding:10px 16px;background:#000000b3;border-radius:7px;pointer-events:all}:host([type="toast"]) .ran-message-notice-content-info{align-items:center;display:flex}:host([type="toast"]) .ran-message-notice-content-info span{margin:0;padding:0;font-size:14px;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";z-index:1010;width:100%;pointer-events:none;color:#fff}.ran-message-notice{padding:var(--ran-message-notice-padding, 8px);text-align:var(--ran-message-notice-text-align, center);max-width:var(--ran-message-notice-max-width, 90%);margin:var(--ran-message-notice-margin, 0 auto);word-break:var(--ran-message-notice-word-break, break-all)}.ran-message-notice-content{display:var(--ran-message-notice-content-display, inline-block);padding:var(--ran-message-notice-content-padding, 10px 16px);background:var(--ran-message-notice-content-background, var(--ran-color-bg-elevated, #fff));border-image-source:var(--ran-message-notice-content-border-image-source, none);border-image-slice:var(--ran-message-notice-content-border-image-slice, 8);border-image-width:var(--ran-message-notice-content-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-message-notice-content-border-radius, var(--ran-radius-md, 12px));box-shadow:var(--ran-message-notice-content-box-shadow, var(--ran-shadow-menu, 0 2px 4px #0000000d, 0 8px 24px -6px #00000024));pointer-events:var(--ran-message-notice-content-pointer-events, all)}.ran-message-notice-content-info{align-items:var(--ran-message-notice-content-info-align-items, center);display:var(--ran-message-notice-content-info-display, flex)}.ran-message-notice-content-info span{margin:var(--ran-message-notice-content-info-span-margin, 0);padding:var(--ran-message-notice-content-info-span-padding, 0);color:var(--ran-message-notice-content-info-span-color, var(--ran-color-text, #000000d9));font-size:var(--ran-message-notice-content-info-span-font-size, 14px);font-variant:var(--ran-message-notice-content-info-span-font-variant, tabular-nums);list-style:var(--ran-message-notice-content-info-span-list-style, none);font-feature-settings:var(--ran-message-notice-content-info-span-font-feature-settings, "tnum");z-index:var(--ran-message-notice-content-info-span-z-index, 1010);width:var(--ran-message-notice-content-info-span-width, 100%);pointer-events:var(--ran-message-notice-content-info-span-pointer-events, none)}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes MessageMoveIn{0%{padding:0;transform:translateY(-100%);opacity:0}to{padding:8px;transform:translateY(0);opacity:1}}@keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}.ranui-message{box-sizing:var(--ran-message-box-sizing, border-box);margin:var(--ran-message-margin, 0);padding:var(--ran-message-padding, 0);color:var(--ran-message-color, var(--ran-color-text, #000000d9));font-size:var(--ran-message-font-size, 14px);font-variant:var(--ran-message-font-variant, tabular-nums);line-height:var(--ran-message-line-height, 1.5715);list-style:var(--ran-message-ist-style, none);font-feature-settings:var(--ran-message-font-feature-settings, "tnum");position:var(--ran-message-position, fixed);top:var(--ran-message-top, 8px);left:var(--ran-message-left, 0);z-index:var(--ran-message-z-index, var(--ran-z-message, 1200));width:var(--ran-message-width, 100%);pointer-events:var(--ran-message-pointer-events, none)}.ranui-message .message-in{animation-name:var(--ran-message-in-animation-name, MessageMoveIn);animation-duration:var(--ran-message-in-animation-duration, .3s);animation-timing-function:var(--ran-message-in-animation-timing-function, cubic-bezier(.78, .14, .15, .86))}.ranui-message .message-leave{animation-name:var(--ran-message-leave-animation-name, MessageMoveOut);animation-duration:var(--ran-message-leave-animation-duration, .3s);animation-timing-function:var(--ran-message-leave-animation-timing-function, cubic-bezier(.78, .14, .15, .86))}',Ws="data-ranui-message-host",tu=()=>`[${Ws}="true"]`,eu=(r,c)=>{const g=c?.top??8,A=c?.zIndex??1200;r.style.setProperty("position","fixed"),r.style.setProperty("top",typeof g=="number"?`${g}px`:String(g)),r.style.setProperty("left","0"),r.style.setProperty("width","100%"),r.style.setProperty("z-index",String(A)),r.style.setProperty("pointer-events","none")},ru=r=>typeof document>"u"?null:r?.getContainer?.()||document.body,iu=r=>{if(typeof document>"u")return null;const c=ru(r)||document.body;let g=c.querySelector(tu());return g||(g=x().attr(Ws,"true").children(x().class("ranui-message").attr("aria-live","polite").attr("aria-atomic","false")).build(),c.appendChild(g)),eu(g,r),g.querySelector(".ranui-message")},ts=300,es=3e3;yi({"check-circle-fill":Ys,"close-circle-fill":Gs,"info-circle-fill":zs,"warning-circle-fill":Vs});var au=new Map([["success","check-circle-fill"],["warning","warning-circle-fill"],["error","close-circle-fill"],["info","info-circle-fill"],["toast",null]]),nu=new Map([["success","#52c41a"],["warning","#faad14"],["error","#ff4d4f"],["info","#006bff"],["toast","rgba(0, 0, 0, 0.7)"]]),Xs=class extends ct{_info;_notice;_content;_icon;_span;_shadowDom;timeId;close;static get observedAttributes(){return["type","content","sheet"]}constructor(){super(),this._shadowDom=ht(this,$h);const r=gt(this._shadowDom,".ran-message-notice",()=>x().class("ran-message-notice").children(x().class("ran-message-notice-content").children(x().class("ran-message-notice-content-info").children(rt("r-icon"),ke()))).build());this._notice=r,this._content=r.querySelector(".ran-message-notice-content"),this._info=r.querySelector(".ran-message-notice-content-info"),this._icon=r.querySelector("r-icon"),this._span=r.querySelector("span"),this.handlerExternalCss()}connectedCallback(){ct.prototype.connectedCallback?.call(this),this.hasAttribute("aria-atomic")||this.setAttribute("aria-atomic","true")}get type(){return this.getAttribute("type")}set type(r){r&&this.setAttribute("type",r)}get content(){return this.getAttribute("content")}set content(r){r&&this.setAttribute("content",r)}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};setA11yRole=r=>{const c=r==="error"||r==="warning";this.setAttribute("role",c?"alert":"status")};setIcon=r=>{const c=au.get(r),g=nu.get(r);c&&(this._icon?.setAttribute("name",c),this._icon?.style.setProperty("margin-right","8px"),this._icon?.setAttribute("size","18"),g&&this._icon?.setAttribute("color",g))};attributeChangedCallback(r,c,g){c!==g&&(r==="content"&&(this._span.textContent=g),r==="type"&&(this.setIcon(g),this.setA11yRole(g)),r==="sheet"&&this.handlerExternalCss())}};dt("r-message",Xs);function ou(){if(typeof window>"u")return null;const r=g=>A=>{const k={},B=rt("r-message").class("message").build();B.timeId&&clearTimeout(B.timeId),B.setAttribute("type",g);let D=es,O;if(!A)return;typeof A=="string"?B.setAttribute("content",A):(B.setAttribute("content",A.content),O=A.close,D=A.duration||es,k.top=A.top,k.zIndex=A.zIndex,k.getContainer=A.getContainer);const Y=iu(k);if(!Y)return;const X=setTimeout(()=>{B.classList.remove("message-in"),B.classList.add("message-leave"),clearTimeout(X)},D-ts);B.timeId=setTimeout(()=>{B.classList.remove("message-leave"),Y.removeChild(B),O&&O()},D),Y.appendChild(B),B.classList.add("message-in"),setTimeout(()=>{B.classList.remove("message-in")},ts)},c={info:r("info"),success:r("success"),error:r("error"),warning:r("warning"),toast:r("toast")};return window.message=c,window.ranui||(window.ranui={}),window.ranui.message=c,c}var Xg=ou(),su='.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}@keyframes skeleton{0%{transform:translate(-37.5%)}to{transform:translate(37.5%)}}.ran-skeleton{position:relative;z-index:0;overflow:hidden;background:0 0;width:100%;height:var(--ran-skeleton-height, 16px);background:var(--ran-skeleton-background, var(--ran-gray-alpha-200, rgba(0, 0, 0, .06)));border-radius:var(--ran-skeleton-border-radius, var(--ran-radius-sm, 6px))}.ran-skeleton:after{position:absolute;top:0;inset-inline-end:-150%;bottom:0;inset-inline-start:-150%;background:var(--ran-skeleton-shimmer, linear-gradient(90deg, var(--ran-gray-alpha-200, rgba(0, 0, 0, .06)) 25%, var(--ran-gray-alpha-500, rgba(0, 0, 0, .15)) 37%, var(--ran-gray-alpha-200, rgba(0, 0, 0, .06)) 63%));animation-name:skeleton;animation-duration:var(--ran-skeleton-animation-duration, 1.4s);animation-timing-function:ease;animation-iteration-count:infinite;content:""}',Zs=class extends ct{_div;_shadowDom;static get observedAttributes(){return["sheet"]}constructor(){super(),this._shadowDom=ht(this,su),this._div=gt(this._shadowDom,".ran-skeleton",()=>x().class("ran-skeleton").build())}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};connectedCallback(){this.handlerExternalCss()}attributeChangedCallback(r,c,g){c!==g&&r==="sheet"&&this.handlerExternalCss()}};dt("r-skeleton",Zs);var lu=".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}",Js=class extends ct{static get observedAttributes(){return["label","key","disabled","icon","effect","iconSize","sheet"]}_events=new xt;_div;parent;_shadowDom;constructor(){super(),this._shadowDom=ht(this,lu);const r=gt(this._shadowDom,"slot",()=>Bt().part("content").build());this._div=r}get label(){return this.getAttribute("label")||""}set label(r){this.setAttribute("label",r)}get icon(){return this.getAttribute("icon")}set icon(r){!r||r==="false"?this.removeAttribute("icon"):this.setAttribute("icon",r)}get iconSize(){return this.getAttribute("iconSize")}set iconSize(r){!r||r==="false"?this.removeAttribute("iconSize"):this.setAttribute("iconSize",r)}get key(){return this.getAttribute("r-key")}set key(r){r?this.setAttribute("r-key",r):this.removeAttribute("r-key")}get disabled(){return this.getAttribute("disabled")}set disabled(r){!r||r==="false"?this.removeAttribute("disabled"):this.setAttribute("disabled",r)}get effect(){return this.getAttribute("effect")}set effect(r){!r||r==="false"?this.removeAttribute("effect"):this.setAttribute("effect",r)}get sheet(){return this.getAttribute("sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};initAttribute=()=>{this.parent=this.parentNode,this.key&&(this.parent?.updateAttribute(this.key,"icon",this.icon),this.parent?.updateAttribute(this.key,"iconSize",this.iconSize),this.parent?.updateAttribute(this.key,"effect",this.effect))};connectedCallback(){this.handlerExternalCss(),this._events.on(document,"DOMContentLoaded",this.initAttribute)}disconnectedCallback(){this._events.abort()}attributeChangedCallback(r,c,g){c!==g&&(this.key&&this.parent?.updateAttribute&&(r==="icon"&&this.parent?.updateAttribute(this.key,"icon",g),r==="iconSize"&&this.parent?.updateAttribute(this.key,"iconSize",g),r==="effect"&&this.parent?.updateAttribute(this.key,"effect",g),r==="disabled"&&this.parent?.updateAttribute(this.key,"disabled",g)),r==="sheet"&&this.handlerExternalCss())}};dt("r-tab",Js);var cu='.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-tab ::slotted(r-tab){box-sizing:border-box;width:100%;height:100%;padding:10px;flex-shrink:0;overflow:auto;text-align:start}.ran-tab-header{position:relative;overflow:hidden;scroll-behavior:smooth}.ran-tab-header-nav{display:flex;flex-flow:row nowrap;justify-content:flex-start;align-items:center}.ran-tab-header-nav::-webkit-scrollbar{display:none}.ran-tab-header-nav-item{flex-shrink:0}.ran-tab-header-nav .active{color:var(--ran-tab-active-color, var(--ran-color-primary, #006bff))}.ran-tab-header-line{position:absolute;width:0;margin-top:-2px;height:2px;border-radius:2px;background:var(--ran-tab-line-color, var(--ran-color-primary, #006bff));transition:var(--ran-tab-line-transition, left .2s, width .2s, transform .2s)}.ran-tab-content{overflow:hidden}.ran-tab-content-wrap{display:flex;width:100%;height:100%;transition:var(--ran-tab-content-transition, transform .2s)}:host([type="line"]) .ran-tab-header-nav-item{border:solid 1px transparent}:host([type="line"]) .ran-tab-header-nav .active{color:var(--ran-tab-line-color, var(--ran-color-primary, #006bff));border:solid 1px transparent;border-color:var(--ran-tab-border-color, var(--ran-color-border, rgba(0, 0, 0, .2))) var(--ran-tab-border-color, var(--ran-color-border, rgba(0, 0, 0, .2))) transparent;border-radius:var(--ran-tab-border-radius, var(--ran-radius-sm, .25em)) var(--ran-tab-border-radius, var(--ran-radius-sm, .25em)) 0 0}:host([type="line"]) .ran-tab-header-line{transition:none;visibility:hidden}:host([type="line"]) .ran-tab-header-line:after,:host([type="line"]) .ran-tab-header-line:before{content:"";position:absolute;visibility:visible;width:9999px;height:1px;bottom:0;background:var(--ran-tab-border-color, var(--ran-color-border, rgba(0, 0, 0, .2)))}:host([type="line"]) .ran-tab-header-line:after{left:100%}:host([type="line"]) .ran-tab-header-line:before{right:100%}:host([align="center"]) .ran-tab-header-nav{justify-content:center}:host([align="center"]) .ran-tab-header-line{left:50%}:host([align="end"]) .ran-tab-header-nav{justify-content:flex-end}',du=0,js=class extends ct{static get observedAttributes(){return["active","type","align","effect","sheet"]}_events=new xt;_container;_header;_nav;_line;_content;_wrap;_slot;_shadowDom;_tabsId;tabHeaderKeyMapIndex;constructor(){super(),this._tabsId=++du,this._shadowDom=ht(this,cu),this.tabHeaderKeyMapIndex={};const r=gt(this._shadowDom,".ran-tab",()=>x().class("ran-tab").part("tabs").children(x().class("ran-tab-header").part("header").children(x().class("ran-tab-header-nav").part("nav"),x().class("ran-tab-header-line").part("indicator")),x().class("ran-tab-content").part("content").children(x().class("ran-tab-content-wrap").part("content-wrap").children(Bt()))).build());this._container=r,this._header=r.querySelector(".ran-tab-header"),this._nav=r.querySelector(".ran-tab-header-nav"),this._line=r.querySelector(".ran-tab-header-line"),this._content=r.querySelector(".ran-tab-content"),this._wrap=r.querySelector(".ran-tab-content-wrap"),this._slot=r.querySelector("slot"),this._nav.setAttribute("role","tablist")}get align(){return _(this,"align","start")}set align(r){this.setAttribute("align",r)}get type(){return _(this,"type","flat")}set type(r){this.setAttribute("type",r)}get active(){return this.getAttribute("active")}set active(r){r?(this.setAttribute("active",r),this.setTabLine(r),this.setTabContent(r),this.syncTabsAria()):this.removeAttribute("active")}get effect(){return this.getAttribute("effect")}set effect(r){!r||r==="false"?this.removeAttribute("effect"):this.setAttribute("effect",r)}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};initTabHeaderKeyMapIndex=(r,c)=>{if(this.tabHeaderKeyMapIndex[r])throw new Error("tab 组件的 key 值存在重复,或者某个 tab 组件缺少 key 属性");this.tabHeaderKeyMapIndex[r]=c};createTabHeader(r,c){const g=r.getAttribute("label")||"",A=r.getAttribute("icon")||"",k=r.getAttribute("iconSize")||"",B=r.getAttribute("r-key")||`${c}`,D=r.getAttribute("type")||"text";this.initTabHeaderKeyMapIndex(B,c);const O=rt("r-button").class("tab-header-nav-item").attr("type",D).attr("r-key",B).text(g);return A&&O.attr("icon",A),k&&O.attr("iconSize",k),yt(r)&&O.attr("disabled",""),this.effect&&(r.setAttribute("effect",this.effect),this._line.style.setProperty("display","none")),r.setAttribute("r-key",B),O.build()}initTabLineAlignCenter=()=>{const{length:r}=this._nav.children;let c=0;for(let g=0;g<r;g++){const{width:A=0}=this._nav.children[g].getBoundingClientRect();c+=A}this._line.style.setProperty("left",`calc(50% - ${c/2}px)`)};initTabLineAlignEnd=()=>{const{length:r}=this._nav.children;let c=0;for(let g=0;g<r;g++){const{width:A=0}=this._nav.children[g].getBoundingClientRect();c+=A}this._line.style.setProperty("left",`calc(100% - ${c}px)`)};setTabLine=r=>{if(r){const c=this.tabHeaderKeyMapIndex[r],{width:g=0}=this._nav.children[c].getBoundingClientRect();this._line.style.setProperty("width",`${g}px`);let A=0;for(let k=0;k<c;k++){const{width:B=0}=this._nav.children[k].getBoundingClientRect();A+=B}this._line.style.setProperty("transform",`translateX(${A}px)`)}};setTabContent=r=>{if(r){const c=this.tabHeaderKeyMapIndex[r];this._wrap.style.setProperty("transform",`translateX(${c*-100}%)`)}};clickTabHead=r=>{const c=r.currentTarget??r.target,g=c.getAttribute("r-key");!yt(c)&&g&&this.activateKey(g)};activateKey=r=>{this.setAttribute("active",r),this.setTabLine(r),this.setTabContent(r),this._nav.querySelectorAll(".active").forEach(g=>g.classList.remove("active"));const c=this.tabHeaderKeyMapIndex[r];this._nav.children[c]?.classList.add("active"),this.syncTabsAria()};tabFocusable=r=>r._btn??r;tabIdFor=r=>`ran-tab-${this._tabsId}-${r}`;panelIdFor=r=>`ran-tabpanel-${this._tabsId}-${r}`;syncTabsAria=()=>{const r=this.active,c=this._slot?.assignedElements?.()??[];[...this._nav.children].forEach((g,A)=>{const k=g.getAttribute("r-key")??`${A}`,B=k===r,D=yt(g),O=this.tabFocusable(g);O.setAttribute("role","tab"),O.id=this.tabIdFor(k),O.setAttribute("aria-controls",this.panelIdFor(k)),O.setAttribute("aria-selected",B?"true":"false"),O.tabIndex=B&&!D?0:-1;const Y=c[A];Y&&(Y.setAttribute("role","tabpanel"),Y.id=this.panelIdFor(k),Y.setAttribute("aria-labelledby",this.tabIdFor(k)),Y.setAttribute("tabindex",B?"0":"-1"),B?Y.removeAttribute("aria-hidden"):Y.setAttribute("aria-hidden","true"))})};onNavKeydown=r=>{if(!["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(r.key))return;const c=[...this._nav.children].filter(D=>!yt(D));if(!c.length)return;const g=r.target?.closest?.(".tab-header-nav-item")??r.target;let A=c.findIndex(D=>D===g);A<0&&(A=c.findIndex(D=>D.getAttribute("r-key")===this.active)),A<0&&(A=0);let k=A;r.key==="ArrowRight"||r.key==="ArrowDown"?k=(A+1)%c.length:r.key==="ArrowLeft"||r.key==="ArrowUp"?k=(A-1+c.length)%c.length:r.key==="Home"?k=0:r.key==="End"&&(k=c.length-1),r.preventDefault();const B=c[k].getAttribute("r-key");B&&(this.activateKey(B),this.tabFocusable(c[k]).focus())};updateAttribute=(r,c,g="")=>{const A=this.tabHeaderKeyMapIndex[r];r&&g&&this._nav.children[A]?this._nav.children[A]?.setAttribute(c,g):this._nav.children[A]?.removeAttribute(c)};initActive=()=>{const r=[...this._nav.children],c=r.filter(B=>!yt(B));let g;if(this.active!=null&&(g=c.find(B=>B.getAttribute("r-key")===this.active),g?.setAttribute("r-key",this.active)),g||(g=c.shift()),!g)return;const A=r.findIndex(B=>B===g),k=g?.getAttribute("r-key")||`${A}`;k!=null&&(this.setAttribute("active",`${k}`),g.classList.add("active"),this.setTabContent(k),setTimeout(()=>{this.setTabLine(k)},200))};listenSlotChange=()=>{this._slot.assignedElements().forEach((r,c)=>{const g=this.createTabHeader(r,c);this._nav.appendChild(g),g.addEventListener("click",this.clickTabHead)}),this.initActive(),this.syncTabsAria(),this.align&&(this.align==="center"&&this.initTabLineAlignCenter(),this.align==="end"&&this.initTabLineAlignEnd())};connectedCallback(){this.handlerExternalCss(),this._events.on(this._slot,"slotchange",this.listenSlotChange),this._events.on(this._nav,"keydown",this.onNavKeydown)}disconnectedCallback(){this._events.abort()}attributeChangedCallback(r,c,g){c!==g&&(this.dispatchEvent(new CustomEvent("change",{detail:{active:this.active}})),r==="align"&&(g==="center"&&this.initTabLineAlignCenter(),g==="end"&&this.initTabLineAlignEnd()),r==="effect"&&[...this._nav.children].forEach(A=>{!this.effect||this.effect==="false"?A.removeAttribute("effect"):A.setAttribute("effect",g)}),r==="active"&&this.setAttribute(r,g),r==="sheet"&&this.handlerExternalCss())}};dt("r-tabs",js);var hu=".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{--ran-radar-polygon-color: var(--ran-color-border, #e6e6e6);--ran-radar-line-color: var(--ran-color-border, #e6e6e6);--ran-radar-fill-color: rgba(255, 121, 35, .6);--ran-radar-stroke-color: rgba(255, 121, 35, .6)}.ran-radar{position:var(--ran-radar-position, relative);width:var(--ran-radar-width, 100%);height:var(--ran-radar-height, 100%);display:var(--ran-radar-display, block)}.ran-radar canvas{width:100%;height:100%}",uu="rgba(0,0,0,0)",gu="rgba(0,0,0,1)",rs="#e6e6e6",is="#e6e6e6",fu="黑体",as="rgba(255,121,35,0.60)",ns="rgba(255,121,35,0.60)",$s=class extends ct{mData;mCount;mW;mCenter;mRadius;mAngle;static get observedAttributes(){return["abilitys","colorpolygon","colorline","fillcolor","strokecolor","sheet"]}abilityRadarChartContainer;abilityRadarChart;_iconElement;_shadowDom;resizeObserver;constructor(){super(),this._shadowDom=ht(this,hu);const r=gt(this._shadowDom,".ran-radar",()=>x().class("ran-radar").children(rt("canvas").build()).build()),c=r.querySelector("canvas");this.abilityRadarChartContainer=r,this.abilityRadarChart=c,this.resizeObserver=new ResizeObserver(this.resize),this.resizeObserver.observe(this.abilityRadarChartContainer)}resize=()=>{this.refreshData()};get abilitys(){const r=this.getAttribute("abilitys");if(typeof r=="string")try{return JSON.parse(r)}catch(c){return console.error(`Failed to parse the rule in JSON.parse: ${r}, error: ${c}`),r}return r}set abilitys(r){typeof r=="string"?this.setAttribute("abilitys",r||""):this.setAttribute("abilitys",JSON.stringify(r)||"")}_cssVar(r){return typeof getComputedStyle>"u"?"":getComputedStyle(this).getPropertyValue(r).trim()}get colorPolygon(){return this.getAttribute("colorPolygon")||this._cssVar("--ran-radar-polygon-color")||rs}set colorPolygon(r){this.setAttribute("colorPolygon",r||rs)}get colorLine(){return this.getAttribute("colorLine")||this._cssVar("--ran-radar-line-color")||is}set colorLine(r){this.setAttribute("colorLine",r||is)}get fontColor(){return this._cssVar("--ran-color-text")||gu}get fillColor(){return this.getAttribute("fillColor")||this._cssVar("--ran-radar-fill-color")||as}set fillColor(r){this.setAttribute("fillColor",r||as)}get strokeColor(){return this.getAttribute("strokeColor")||this._cssVar("--ran-radar-stroke-color")||ns}set strokeColor(r){this.setAttribute("strokeColor",r||ns)}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};refreshData(){const r=this.abilityRadarChart.getContext("2d");if(!this.abilityRadarChartContainer||!r)return;const c=vr(r),g=this.abilityRadarChartContainer.clientWidth*c,A=this.abilityRadarChartContainer.clientHeight*c;this.abilityRadarChart.width=g,this.abilityRadarChart.height=A,this.mW=g,this.mData=this.abilitys,this.mCount=this.mData?.length||1,this.mCenter=this.mW/2,this.mRadius=this.mCenter-50*c,this.mAngle=Math.PI*2/this.mCount,this.drawPolygon(r),this.drawSide(r),this.drawLines(r),this.drawText(r),this.drawRegion(r),this.drawCircle(r)}drawSide(r){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)return;r.save(),r.strokeStyle=this.colorLine;const c=this.mRadius;for(let g=0;g<this.mCount;g++){const A=this.mCenter+c*Math.sin(this.mAngle*g),k=this.mCenter+c*Math.cos(this.mAngle*g);r.lineTo(A,k)}r.closePath(),r.stroke()}drawPolygon(r){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)return;r.save(),r.strokeStyle=this.colorPolygon;const c=this.mRadius/4;r.setLineDash([6,6]);for(let g=0;g<4;g++){r.beginPath();const A=c*(g+1);for(let k=0;k<this.mCount;k++){const B=this.mCenter+A*Math.sin(this.mAngle*k),D=this.mCenter+A*Math.cos(this.mAngle*k);r.lineTo(B,D)}r.closePath(),r.stroke()}r.restore()}drawLines(r){if(!(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle)){r.save(),r.beginPath(),r.strokeStyle=this.colorLine;for(let c=0;c<this.mCount;c++){const g=this.mCenter+this.mRadius*Math.sin(this.mAngle*c),A=this.mCenter+this.mRadius*Math.cos(this.mAngle*c);r.moveTo(this.mCenter,this.mCenter),r.lineTo(g,A)}r.stroke(),r.restore()}}drawText(r){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;r.save();const c=vr(r),g=this.mCenter/12;for(let A=0;A<this.mCount;A++){const k=this.mCenter+this.mRadius*Math.sin(this.mAngle*A),B=this.mCenter+this.mRadius*Math.cos(this.mAngle*A),D=this.mData[A]?.backgroundColor||uu,O=this.mData[A]?.fontColor||this.fontColor,Y=this.mData[A]?.fontFamily||fu,X=this.mData[A]?.fontSize||g;r.font=`${X}px ${Y}`,this.mAngle*A>=0&&this.mAngle*A<Math.PI/2?this.drawButton(r,D,k,B,44*c,24*c,12*c,this.mData[A].abilityName,O,Y,X):this.mAngle*A>=Math.PI/2&&this.mAngle*A<Math.PI?this.drawButton(r,D,k,B-24*c,44*c,24*c,12*c,this.mData[A].abilityName,O,Y,X):this.mAngle*A>=Math.PI&&this.mAngle*A<Math.PI*3/2?this.drawButton(r,D,k-44*c,B-24*c,44*c,24*c,12*c,this.mData[A].abilityName,O,Y,X):this.drawButton(r,D,k-44*c,B,44*c,24*c,12*c,this.mData[A].abilityName,O,Y,X)}r.restore()}drawButton(r,c,g,A,k,B,D,O,Y,X,wt){r.beginPath();const pt=vr(r);r.fillStyle=c,r.moveTo(g+D,A),r.lineTo(g+k-D,A),r.arc(g+k-D,A+D,D,Math.PI*3/2,Math.PI*2),r.lineTo(g+k,A+B-D),r.arc(g+k-D,A+B-D,D,Math.PI,Math.PI/2),r.lineTo(g+D,A+B),r.arc(g+D,A+B-D,D,Math.PI/2,Math.PI),r.lineTo(g,A+D),r.arc(g+D,A+D,D,Math.PI,Math.PI*3/2),r.fill(),r.closePath(),r.beginPath(),r.fillStyle=Y,r.font=`${wt||12*pt}px ${X}`,r.textAlign="center",r.textBaseline="middle",r.fillText(O,g+k/2,A+B/2)}drawRegion(r){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;const c=vr(r);r.save(),r.beginPath();for(let g=0;g<this.mCount;g++){const A=this.mCenter+this.mRadius*Math.sin(this.mAngle*g)*this.mData[g].scoreRate/100,k=this.mCenter+this.mRadius*Math.cos(this.mAngle*g)*this.mData[g].scoreRate/100;r.lineTo(A,k)}r.closePath(),r.fillStyle=this.fillColor,r.fill(),r.strokeStyle=this.strokeColor,r.lineWidth=1*c,r.stroke(),r.restore()}drawCircle(r){if(!this.mRadius||!this.mCount||!this.mCenter||!this.mAngle||!this.mData)return;const c=vr(r);r.save();for(let g=0;g<this.mCount;g++){const A=this.mCenter+this.mRadius*Math.sin(this.mAngle*g)*this.mData[g].scoreRate/100,k=this.mCenter+this.mRadius*Math.cos(this.mAngle*g)*this.mData[g].scoreRate/100;r.beginPath(),r.arc(A,k,3,0,Math.PI*2),r.lineWidth=1.5*c,r.strokeStyle=this.strokeColor,r.stroke()}r.restore()}connectedCallback(){this.handlerExternalCss(),this.refreshData()}disconnectedCallback(){this.resizeObserver.disconnect()}attributeChangedCallback(r,c,g){c!==g&&(["abilitys","colorpolygon","colorline","fillcolor","strokecolor"].includes(r)&&this.abilityRadarChartContainer&&this.refreshData(),r==="sheet"&&this.handlerExternalCss())}};dt("r-radar",$s);var pu=fs.__commonJSMin(((r,c)=>{(function g(A){var k=this,B=function(){"use strict";function D(s,n){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(s);n&&(e=e.filter(function(i){return Object.getOwnPropertyDescriptor(s,i).enumerable})),t.push.apply(t,e)}return t}function O(s){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?D(Object(t),!0).forEach(function(e){wt(s,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):D(Object(t)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(t,e))})}return s}function Y(s,n){for(var t=0;t<n.length;t++){var e=n[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(s,kt(e.key),e)}}function X(s,n,t){return n&&Y(s.prototype,n),t&&Y(s,t),Object.defineProperty(s,"prototype",{writable:!1}),s}function wt(s,n,t){return(n=kt(n))in s?Object.defineProperty(s,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[n]=t,s}function pt(){return pt=Object.assign?Object.assign.bind():function(s){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s[e]=t[e])}return s},pt.apply(this,arguments)}function Et(s,n){s.prototype=Object.create(n.prototype),s.prototype.constructor=s,Ot(s,n)}function $t(s){return $t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},$t(s)}function Ot(s,n){return Ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ot(s,n)}function mt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vt(s,n,t){return Vt=mt()?Reflect.construct.bind():function(e,i,a){var o=[null];o.push.apply(o,i);var l=new(Function.bind.apply(e,o));return a&&Ot(l,a.prototype),l},Vt.apply(null,arguments)}function Tt(s){var n=typeof Map=="function"?new Map:void 0;return Tt=function(t){if(t===null||(e=t,Function.toString.call(e).indexOf("[native code]")===-1))return t;var e;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(n!==void 0){if(n.has(t))return n.get(t);n.set(t,i)}function i(){return Vt(t,arguments,$t(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ot(i,t)},Tt(s)}function qt(s,n){(n==null||n>s.length)&&(n=s.length);for(var t=0,e=new Array(n);t<n;t++)e[t]=s[t];return e}function Pt(s,n){var t=typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(t)return(t=t.call(s)).next.bind(t);if(Array.isArray(s)||(t=(function(i,a){if(i){if(typeof i=="string")return qt(i,a);var o=Object.prototype.toString.call(i).slice(8,-1);return o==="Object"&&i.constructor&&(o=i.constructor.name),o==="Map"||o==="Set"?Array.from(i):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?qt(i,a):void 0}})(s))||n&&s&&typeof s.length=="number"){t&&(s=t);var e=0;return function(){return e>=s.length?{done:!0}:{done:!1,value:s[e++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
242
242
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kt(s){var n=(function(t,e){if(typeof t!="object"||t===null)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var a=i.call(t,e||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)})(s,"string");return typeof n=="symbol"?n:String(n)}function _t(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var ie={exports:{}};(function(s,n){var t=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,e=/^(?=([^\/?#]*))\1([^]*)$/,i=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,d,h){if(h=h||{},l=l.trim(),!(d=d.trim())){if(!h.alwaysNormalize)return l;var u=o.parseURL(l);if(!u)throw new Error("Error trying to parse base URL.");return u.path=o.normalizePath(u.path),o.buildURLFromParts(u)}var f=o.parseURL(d);if(!f)throw new Error("Error trying to parse relative URL.");if(f.scheme)return h.alwaysNormalize?(f.path=o.normalizePath(f.path),o.buildURLFromParts(f)):d;var p=o.parseURL(l);if(!p)throw new Error("Error trying to parse base URL.");if(!p.netLoc&&p.path&&p.path[0]!=="/"){var m=e.exec(p.path);p.netLoc=m[1],p.path=m[2]}p.netLoc&&!p.path&&(p.path="/");var v={scheme:p.scheme,netLoc:f.netLoc,path:null,params:f.params,query:f.query,fragment:f.fragment};if(!f.netLoc&&(v.netLoc=p.netLoc,f.path[0]!=="/"))if(f.path){var y=p.path,E=y.substring(0,y.lastIndexOf("/")+1)+f.path;v.path=o.normalizePath(E)}else v.path=p.path,f.params||(v.params=p.params,f.query||(v.query=p.query));return v.path===null&&(v.path=h.alwaysNormalize?o.normalizePath(f.path):f.path),o.buildURLFromParts(v)},parseURL:function(l){var d=t.exec(l);return d?{scheme:d[1]||"",netLoc:d[2]||"",path:d[3]||"",params:d[4]||"",query:d[5]||"",fragment:d[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(i,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};s.exports=o})(ie);var he=ie.exports,Z=Number.isFinite||function(s){return typeof s=="number"&&isFinite(s)},w=(function(s){return s.MEDIA_ATTACHING="hlsMediaAttaching",s.MEDIA_ATTACHED="hlsMediaAttached",s.MEDIA_DETACHING="hlsMediaDetaching",s.MEDIA_DETACHED="hlsMediaDetached",s.BUFFER_RESET="hlsBufferReset",s.BUFFER_CODECS="hlsBufferCodecs",s.BUFFER_CREATED="hlsBufferCreated",s.BUFFER_APPENDING="hlsBufferAppending",s.BUFFER_APPENDED="hlsBufferAppended",s.BUFFER_EOS="hlsBufferEos",s.BUFFER_FLUSHING="hlsBufferFlushing",s.BUFFER_FLUSHED="hlsBufferFlushed",s.MANIFEST_LOADING="hlsManifestLoading",s.MANIFEST_LOADED="hlsManifestLoaded",s.MANIFEST_PARSED="hlsManifestParsed",s.LEVEL_SWITCHING="hlsLevelSwitching",s.LEVEL_SWITCHED="hlsLevelSwitched",s.LEVEL_LOADING="hlsLevelLoading",s.LEVEL_LOADED="hlsLevelLoaded",s.LEVEL_UPDATED="hlsLevelUpdated",s.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",s.LEVELS_UPDATED="hlsLevelsUpdated",s.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",s.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",s.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",s.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",s.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",s.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",s.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",s.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",s.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",s.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",s.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",s.CUES_PARSED="hlsCuesParsed",s.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",s.INIT_PTS_FOUND="hlsInitPtsFound",s.FRAG_LOADING="hlsFragLoading",s.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",s.FRAG_LOADED="hlsFragLoaded",s.FRAG_DECRYPTED="hlsFragDecrypted",s.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",s.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",s.FRAG_PARSING_METADATA="hlsFragParsingMetadata",s.FRAG_PARSED="hlsFragParsed",s.FRAG_BUFFERED="hlsFragBuffered",s.FRAG_CHANGED="hlsFragChanged",s.FPS_DROP="hlsFpsDrop",s.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",s.ERROR="hlsError",s.DESTROYING="hlsDestroying",s.KEY_LOADING="hlsKeyLoading",s.KEY_LOADED="hlsKeyLoaded",s.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",s.BACK_BUFFER_REACHED="hlsBackBufferReached",s})({}),J=(function(s){return s.NETWORK_ERROR="networkError",s.MEDIA_ERROR="mediaError",s.KEY_SYSTEM_ERROR="keySystemError",s.MUX_ERROR="muxError",s.OTHER_ERROR="otherError",s})({}),F=(function(s){return s.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",s.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",s.KEY_SYSTEM_NO_SESSION="keySystemNoSession",s.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",s.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",s.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",s.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",s.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",s.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",s.MANIFEST_LOAD_ERROR="manifestLoadError",s.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",s.MANIFEST_PARSING_ERROR="manifestParsingError",s.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",s.LEVEL_EMPTY_ERROR="levelEmptyError",s.LEVEL_LOAD_ERROR="levelLoadError",s.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",s.LEVEL_PARSING_ERROR="levelParsingError",s.LEVEL_SWITCH_ERROR="levelSwitchError",s.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",s.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",s.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",s.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",s.FRAG_LOAD_ERROR="fragLoadError",s.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",s.FRAG_DECRYPT_ERROR="fragDecryptError",s.FRAG_PARSING_ERROR="fragParsingError",s.FRAG_GAP="fragGap",s.REMUX_ALLOC_ERROR="remuxAllocError",s.KEY_LOAD_ERROR="keyLoadError",s.KEY_LOAD_TIMEOUT="keyLoadTimeOut",s.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",s.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",s.BUFFER_APPEND_ERROR="bufferAppendError",s.BUFFER_APPENDING_ERROR="bufferAppendingError",s.BUFFER_STALLED_ERROR="bufferStalledError",s.BUFFER_FULL_ERROR="bufferFullError",s.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",s.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",s.INTERNAL_EXCEPTION="internalException",s.INTERNAL_ABORTED="aborted",s.UNKNOWN="unknown",s})({}),ue=function(){},$e={trace:ue,debug:ue,log:ue,warn:ue,info:ue,error:ue},Ie=$e;function wi(s){var n=self.console[s];return n?n.bind(self.console,"["+s+"] >"):ue}function xr(s,n){if(self.console&&s===!0||typeof s=="object"){(function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),a=1;a<e;a++)i[a-1]=arguments[a];i.forEach(function(o){Ie[o]=t[o]?t[o].bind(t):wi(o)})})(s,"debug","log","info","warn","error");try{Ie.log('Debug logs enabled for "'+n+'" in hls.js version 1.4.12')}catch{Ie=$e}}else Ie=$e}var T=Ie,Ci=/^(\d+)x(\d+)$/,Tr=/(.+?)=(".*?"|.*?)(?:,|$)/g,Ct=(function(){function s(t){for(var e in typeof t=="string"&&(t=s.parseAttrList(t)),t)t.hasOwnProperty(e)&&(e.substring(0,2)==="X-"&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(e)),this[e]=t[e])}var n=s.prototype;return n.decimalInteger=function(t){var e=parseInt(this[t],10);return e>Number.MAX_SAFE_INTEGER?1/0:e},n.hexadecimalInteger=function(t){if(this[t]){var e=(this[t]||"0x").slice(2);e=(1&e.length?"0":"")+e;for(var i=new Uint8Array(e.length/2),a=0;a<e.length/2;a++)i[a]=parseInt(e.slice(2*a,2*a+2),16);return i}return null},n.hexadecimalIntegerAsNumber=function(t){var e=parseInt(this[t],16);return e>Number.MAX_SAFE_INTEGER?1/0:e},n.decimalFloatingPoint=function(t){return parseFloat(this[t])},n.optionalFloat=function(t,e){var i=this[t];return i?parseFloat(i):e},n.enumeratedString=function(t){return this[t]},n.bool=function(t){return this[t]==="YES"},n.decimalResolution=function(t){var e=Ci.exec(this[t]);if(e!==null)return{width:parseInt(e[1],10),height:parseInt(e[2],10)}},s.parseAttrList=function(t){var e,i={};for(Tr.lastIndex=0;(e=Tr.exec(t))!==null;){var a=e[2];a.indexOf('"')===0&&a.lastIndexOf('"')===a.length-1&&(a=a.slice(1,-1)),i[e[1].trim()]=a}return i},s})();function Ei(s){return s==="SCTE35-OUT"||s==="SCTE35-IN"}var Dr=(function(){function s(n,t){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,t){var e=t.attr;for(var i in e)if(Object.prototype.hasOwnProperty.call(n,i)&&n[i]!==e[i]){T.warn('DATERANGE tag attribute: "'+i+'" does not match for tags with ID: "'+n.ID+'"'),this._badValueForSameId=i;break}n=pt(new Ct({}),e,n)}if(this.attr=n,this._startDate=new Date(n["START-DATE"]),"END-DATE"in this.attr){var a=new Date(this.attr["END-DATE"]);Z(a.getTime())&&(this._endDate=a)}}return X(s,[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var n=this.duration;return n!==null?new Date(this._startDate.getTime()+1e3*n):null}},{key:"duration",get:function(){if("DURATION"in this.attr){var n=this.attr.decimalFloatingPoint("DURATION");if(Z(n))return n}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}},{key:"endOnNext",get:function(){return this.attr.bool("END-ON-NEXT")}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&Z(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}]),s})(),Qe=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}},Dt="audio",Qt="video",tr="audiovideo",Rr=(function(){function s(n){var t;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=((t={})[Dt]=null,t[Qt]=null,t[tr]=null,t),this.baseurl=n}return s.prototype.setByteRange=function(n,t){var e=n.split("@",2),i=[];e.length===1?i[0]=t?t.byteRangeEndOffset:0:i[0]=parseInt(e[1]),i[1]=parseInt(e[0])+i[0],this._byteRange=i},X(s,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=he.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(n){this._url=n}}]),s})(),er=(function(s){function n(e,i){var a;return(a=s.call(this,i)||this)._decryptdata=null,a.rawProgramDateTime=null,a.programDateTime=null,a.tagList=[],a.duration=0,a.sn=0,a.levelkeys=void 0,a.type=void 0,a.loader=null,a.keyLoader=null,a.level=-1,a.cc=0,a.startPTS=void 0,a.endPTS=void 0,a.startDTS=void 0,a.endDTS=void 0,a.start=0,a.deltaPTS=void 0,a.maxStartPTS=void 0,a.minEndPTS=void 0,a.stats=new Qe,a.urlId=0,a.data=void 0,a.bitrateTest=!1,a.title=null,a.initSegment=null,a.endList=void 0,a.gap=void 0,a.type=e,a}Et(n,s);var t=n.prototype;return t.setKeyFormat=function(e){if(this.levelkeys){var i=this.levelkeys[e];i&&!this._decryptdata&&(this._decryptdata=i.getDecryptData(this.sn))}},t.abortRequests=function(){var e,i;(e=this.loader)==null||e.abort(),(i=this.keyLoader)==null||i.abort()},t.setElementaryStreamInfo=function(e,i,a,o,l,d){d===void 0&&(d=!1);var h=this.elementaryStreams,u=h[e];u?(u.startPTS=Math.min(u.startPTS,i),u.endPTS=Math.max(u.endPTS,a),u.startDTS=Math.min(u.startDTS,o),u.endDTS=Math.max(u.endDTS,l)):h[e]={startPTS:i,endPTS:a,startDTS:o,endDTS:l,partial:d}},t.clearElementaryStreamInfo=function(){var e=this.elementaryStreams;e[Dt]=null,e[Qt]=null,e[tr]=null},X(n,[{key:"decryptdata",get:function(){if(!this.levelkeys&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){var e=this.levelkeys.identity;if(e)this._decryptdata=e.getDecryptData(this.sn);else{var i=Object.keys(this.levelkeys);if(i.length===1)return this._decryptdata=this.levelkeys[i[0]].getDecryptData(this.sn)}}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null||!Z(this.programDateTime))return null;var e=Z(this.duration)?this.duration:0;return this.programDateTime+1e3*e}},{key:"encrypted",get:function(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var i=Object.keys(this.levelkeys),a=i.length;if(a>1||a===1&&this.levelkeys[i[0]].encrypted)return!0}return!1}}]),n})(Rr),ki=(function(s){function n(t,e,i,a,o){var l;(l=s.call(this,i)||this).fragOffset=0,l.duration=0,l.gap=!1,l.independent=!1,l.relurl=void 0,l.fragment=void 0,l.index=void 0,l.stats=new Qe,l.duration=t.decimalFloatingPoint("DURATION"),l.gap=t.bool("GAP"),l.independent=t.bool("INDEPENDENT"),l.relurl=t.enumeratedString("URI"),l.fragment=e,l.index=a;var d=t.enumeratedString("BYTERANGE");return d&&l.setByteRange(d,o),o&&(l.fragOffset=o.fragOffset+o.duration),l}return Et(n,s),X(n,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var t=this.elementaryStreams;return!!(t.audio||t.video||t.audiovideo)}}]),n})(Rr),Ii=(function(){function s(n){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=n}return s.prototype.reloaded=function(n){if(!n)return this.advanced=!0,void(this.updated=!0);var t=this.lastPartSn-n.lastPartSn,e=this.lastPartIndex-n.lastPartIndex;this.updated=this.endSN!==n.endSN||!!e||!!t||!this.live,this.advanced=this.endSN>n.endSN||t>0||t===0&&e>0,this.updated||this.advanced?this.misses=Math.floor(.6*n.misses):this.misses=n.misses+1,this.availabilityDelay=n.availabilityDelay},X(s,[{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&Z(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var n=this.driftEndTime-this.driftStartTime;return n>0?1e3*(this.driftEnd-this.driftStart)/n:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var n;return(n=this.partList)!=null&&n.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var n;return(n=this.fragments)!=null&&n.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var n;return(n=this.partList)!=null&&n.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var n;return(n=this.partList)!=null&&n.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),s})();function rr(s){return Uint8Array.from(atob(s),function(n){return n.charCodeAt(0)})}function Bi(s){var n,t,e=s.split(":"),i=null;if(e[0]==="data"&&e.length===2){var a=e[1].split(";"),o=a[a.length-1].split(",");if(o.length===2){var l=o[0]==="base64",d=o[1];l?(a.splice(-1,1),i=rr(d)):(n=Mr(d).subarray(0,16),(t=new Uint8Array(16)).set(n,16-n.length),i=t)}}return i}function Mr(s){return Uint8Array.from(unescape(encodeURIComponent(s)),function(n){return n.charCodeAt(0)})}var bt={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},ir="org.w3.clearkey",ar="com.apple.streamingkeydelivery",Be="com.microsoft.playready",Fr="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function en(s){switch(s){case ar:return bt.FAIRPLAY;case Be:return bt.PLAYREADY;case Fr:return bt.WIDEVINE;case ir:return bt.CLEARKEY}}var rn="edef8ba979d64acea3c827dcd51d21ed";function an(s){switch(s){case bt.FAIRPLAY:return ar;case bt.PLAYREADY:return Be;case bt.WIDEVINE:return Fr;case bt.CLEARKEY:return ir}}function Li(s){var n=s.drmSystems,t=s.widevineLicenseUrl,e=n?[bt.FAIRPLAY,bt.WIDEVINE,bt.PLAYREADY,bt.CLEARKEY].filter(function(i){return!!n[i]}):[];return!e[bt.WIDEVINE]&&t&&e.push(bt.WIDEVINE),e}var nn=typeof self<"u"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function Le(s,n,t){return Uint8Array.prototype.slice?s.slice(n,t):new Uint8Array(Array.prototype.slice.call(s,n,t))}var Si,xi=function(s,n){return n+10<=s.length&&s[n]===73&&s[n+1]===68&&s[n+2]===51&&s[n+3]<255&&s[n+4]<255&&s[n+6]<128&&s[n+7]<128&&s[n+8]<128&&s[n+9]<128},on=function(s,n){return n+10<=s.length&&s[n]===51&&s[n+1]===68&&s[n+2]===73&&s[n+3]<255&&s[n+4]<255&&s[n+6]<128&&s[n+7]<128&&s[n+8]<128&&s[n+9]<128},Or=function(s,n){for(var t=n,e=0;xi(s,n);)e+=10,e+=Pr(s,n+6),on(s,n+10)&&(e+=10),n+=e;if(e>0)return s.subarray(t,t+e)},Pr=function(s,n){var t=0;return t=(127&s[n])<<21,t|=(127&s[n+1])<<14,t|=(127&s[n+2])<<7,t|=127&s[n+3]},Tl=function(s,n){return xi(s,n)&&Pr(s,n+6)+10<=s.length-n},sn=function(s){return s&&s.key==="PRIV"&&s.info==="com.apple.streaming.transportStreamTimestamp"},Dl=function(s){var n=String.fromCharCode(s[0],s[1],s[2],s[3]),t=Pr(s,4);return{type:n,size:t,data:s.subarray(10,10+t)}},ln=function(s){for(var n=0,t=[];xi(s,n);){for(var e=Pr(s,n+6),i=(n+=10)+e;n+8<i;){var a=Dl(s.subarray(n)),o=Rl(a);o&&t.push(o),n+=a.size+10}on(s,n)&&(n+=10)}return t},Rl=function(s){return s.type==="PRIV"?Ml(s):s.type[0]==="W"?Ol(s):Fl(s)},Ml=function(s){if(!(s.size<2)){var n=ae(s.data,!0),t=new Uint8Array(s.data.subarray(n.length+1));return{key:s.type,info:n,data:t.buffer}}},Fl=function(s){if(!(s.size<2)){if(s.type==="TXXX"){var n=1,t=ae(s.data.subarray(n),!0);n+=t.length+1;var e=ae(s.data.subarray(n));return{key:s.type,info:t,data:e}}var i=ae(s.data.subarray(1));return{key:s.type,data:i}}},Ol=function(s){if(s.type==="WXXX"){if(s.size<2)return;var n=1,t=ae(s.data.subarray(n),!0);n+=t.length+1;var e=ae(s.data.subarray(n));return{key:s.type,info:t,data:e}}var i=ae(s.data);return{key:s.type,data:i}},Pl=function(s){if(s.data.byteLength===8){var n=new Uint8Array(s.data),t=1&n[3],e=(n[4]<<23)+(n[5]<<15)+(n[6]<<7)+n[7];return e/=45,t&&(e+=4772185884e-2),Math.round(e)}},ae=function(s,n){n===void 0&&(n=!1);var t=Ul();if(t){var e=t.decode(s);if(n){var i=e.indexOf("\0");return i!==-1?e.substring(0,i):e}return e.replace(/\0/g,"")}for(var a,o,l,d=s.length,h="",u=0;u<d;){if((a=s[u++])===0&&n)return h;if(a!==0&&a!==3)switch(a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:h+=String.fromCharCode(a);break;case 12:case 13:o=s[u++],h+=String.fromCharCode((31&a)<<6|63&o);break;case 14:o=s[u++],l=s[u++],h+=String.fromCharCode((15&a)<<12|(63&o)<<6|(63&l)<<0)}}return h};function Ul(){return Si||self.TextDecoder===void 0||(Si=new self.TextDecoder("utf-8")),Si}var ne=function(s){for(var n="",t=0;t<s.length;t++){var e=s[t].toString(16);e.length<2&&(e="0"+e),n+=e}return n},Ur=Math.pow(2,32)-1,Ql=[].push,cn={video:1,audio:2,id3:3,text:4};function Rt(s){return String.fromCharCode.apply(null,s)}function dn(s,n){var t=s[n]<<8|s[n+1];return t<0?65536+t:t}function et(s,n){var t=hn(s,n);return t<0?4294967296+t:t}function hn(s,n){return s[n]<<24|s[n+1]<<16|s[n+2]<<8|s[n+3]}function Ti(s,n,t){s[n]=t>>24,s[n+1]=t>>16&255,s[n+2]=t>>8&255,s[n+3]=255&t}function st(s,n){var t=[];if(!n.length)return t;for(var e=s.byteLength,i=0;i<e;){var a=et(s,i),o=a>1?i+a:e;if(Rt(s.subarray(i+4,i+8))===n[0])if(n.length===1)t.push(s.subarray(i+8,o));else{var l=st(s.subarray(i+8,o),n.slice(1));l.length&&Ql.apply(t,l)}i=o}return t}function Nl(s){var n=[],t=s[0],e=8,i=et(s,e);e+=4,e+=t===0?8:16,e+=2;var a=s.length+0,o=dn(s,e);e+=2;for(var l=0;l<o;l++){var d=e,h=et(s,d);d+=4;var u=2147483647&h;if((2147483648&h)>>>31==1)return T.warn("SIDX has hierarchical references (not supported)"),null;var f=et(s,d);d+=4,n.push({referenceSize:u,subsegmentDuration:f,info:{duration:f/i,start:a,end:a+u-1}}),a+=u,e=d+=4}return{earliestPresentationTime:0,timescale:i,version:t,referencesCount:o,references:n}}function un(s){for(var n=[],t=st(s,["moov","trak"]),e=0;e<t.length;e++){var i=t[e],a=st(i,["tkhd"])[0];if(a){var o=a[0],l=o===0?12:20,d=et(a,l),h=st(i,["mdia","mdhd"])[0];if(h){var u=et(h,l=(o=h[0])===0?12:20),f=st(i,["mdia","hdlr"])[0];if(f){var p=Rt(f.subarray(8,12)),m={soun:Dt,vide:Qt}[p];if(m){var v=st(i,["mdia","minf","stbl","stsd"])[0],y=void 0;v&&(y=Rt(v.subarray(12,16))),n[d]={timescale:u,type:m},n[m]={timescale:u,id:d,codec:y}}}}}}return st(s,["moov","mvex","trex"]).forEach(function(E){var b=n[et(E,4)];b&&(b.default={duration:et(E,12),flags:et(E,20)})}),n}function gn(s){var n=st(s,["schm"])[0];if(n){var t=Rt(n.subarray(4,8));if(t==="cbcs"||t==="cenc")return st(s,["schi","tenc"])[0]}return T.error("[eme] missing 'schm' box"),null}function Hl(s){var n=et(s,0),t=8;1&n&&(t+=4),4&n&&(t+=4);for(var e=0,i=et(s,4),a=0;a<i;a++)256&n&&(e+=et(s,t),t+=4),512&n&&(t+=4),1024&n&&(t+=4),2048&n&&(t+=4);return e}function Se(s,n){var t=new Uint8Array(s.length+n.length);return t.set(s),t.set(n,s.length),t}function fn(s,n){var t=[],e=n.samples,i=n.timescale,a=n.id,o=!1;return st(e,["moof"]).map(function(l){var d=l.byteOffset-8;st(l,["traf"]).map(function(h){var u=st(h,["tfdt"]).map(function(f){var p=f[0],m=et(f,4);return p===1&&(m*=Math.pow(2,32),m+=et(f,8)),m/i})[0];return u!==void 0&&(s=u),st(h,["tfhd"]).map(function(f){var p=et(f,4),m=16777215&et(f,0),v=0,y=(16&m)!=0,E=0,b=(32&m)!=0,C=8;p===a&&((1&m)!=0&&(C+=8),(2&m)!=0&&(C+=4),(8&m)!=0&&(v=et(f,C),C+=4),y&&(E=et(f,C),C+=4),b&&(C+=4),n.type==="video"&&(o=(function(L){if(!L)return!1;var I=L.indexOf("."),S=I<0?L:L.substring(0,I);return S==="hvc1"||S==="hev1"||S==="dvh1"||S==="dvhe"})(n.codec)),st(h,["trun"]).map(function(L){var I=L[0],S=16777215&et(L,0),R=(1&S)!=0,M=0,Q=(4&S)!=0,P=(256&S)!=0,U=0,K=(512&S)!=0,H=0,V=(1024&S)!=0,j=(2048&S)!=0,q=0,W=et(L,4),tt=8;R&&(M=et(L,tt),tt+=4),Q&&(tt+=4);for(var G=M+d,at=0;at<W;at++){if(P?(U=et(L,tt),tt+=4):U=v,K?(H=et(L,tt),tt+=4):H=E,V&&(tt+=4),j&&(q=I===0?et(L,tt):hn(L,tt),tt+=4),n.type===Qt)for(var nt=0;nt<H;){var lt=et(e,G);Kl(o,e[G+=4])&&pn(e.subarray(G,G+lt),o?2:1,s+q/i,t),G+=lt,nt+=lt+4}s+=U/i}}))})})}),t}function Kl(s,n){if(s){var t=n>>1&63;return t===39||t===40}return(31&n)==6}function pn(s,n,t,e){var i=An(s),a=0;a+=n;for(var o=0,l=0,d=!1,h=0;a<i.length;){o=0;do{if(a>=i.length)break;o+=h=i[a++]}while(h===255);l=0;do{if(a>=i.length)break;l+=h=i[a++]}while(h===255);var u=i.length-a;if(!d&&o===4&&a<i.length){if(d=!0,i[a++]===181){var f=dn(i,a);if(a+=2,f===49){var p=et(i,a);if(a+=4,p===1195456820){var m=i[a++];if(m===3){var v=i[a++],y=64&v,E=y?2+3*(31&v):0,b=new Uint8Array(E);if(y){b[0]=v;for(var C=1;C<E;C++)b[C]=i[a++]}e.push({type:m,payloadType:o,pts:t,bytes:b})}}}}}else if(o===5&&l<u){if(d=!0,l>16){for(var L=[],I=0;I<16;I++){var S=i[a++].toString(16);L.push(S.length==1?"0"+S:S),I!==3&&I!==5&&I!==7&&I!==9||L.push("-")}for(var R=l-16,M=new Uint8Array(R),Q=0;Q<R;Q++)M[Q]=i[a++];e.push({payloadType:o,pts:t,uuid:L.join(""),userData:ae(M),userDataBytes:M})}}else if(l<u)a+=l;else if(l>u)break}}function An(s){for(var n=s.byteLength,t=[],e=1;e<n-2;)s[e]===0&&s[e+1]===0&&s[e+2]===3?(t.push(e+2),e+=2):e++;if(t.length===0)return s;var i=n-t.length,a=new Uint8Array(i),o=0;for(e=0;e<i;o++,e++)o===t[0]&&(o++,t.shift()),a[e]=s[o];return a}function Yl(s,n,t){if(s.byteLength!==16)throw new RangeError("Invalid system id");var e,i,a;if(n){e=1,i=new Uint8Array(16*n.length);for(var o=0;o<n.length;o++){var l=n[o];if(l.byteLength!==16)throw new RangeError("Invalid key");i.set(l,16*o)}}else e=0,i=new Uint8Array;e>0?(a=new Uint8Array(4),n.length>0&&new DataView(a.buffer).setUint32(0,n.length,!1)):a=new Uint8Array;var d=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(d.buffer).setUint32(0,t.byteLength,!1),(function(h){for(var u=arguments.length,f=new Array(u>1?u-1:0),p=1;p<u;p++)f[p-1]=arguments[p];for(var m=f.length,v=8,y=m;y--;)v+=f[y].byteLength;var E=new Uint8Array(v);for(E[0]=v>>24&255,E[1]=v>>16&255,E[2]=v>>8&255,E[3]=255&v,E.set(h,4),y=0,v=8;y<m;y++)E.set(f[y],v),v+=f[y].byteLength;return E})([112,115,115,104],new Uint8Array([e,0,0,0]),s,a,i,d,t||new Uint8Array)}var Qr={},Di=(function(){function s(t,e,i,a,o){a===void 0&&(a=[1]),o===void 0&&(o=null),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=t,this.uri=e,this.keyFormat=i,this.keyFormatVersions=a,this.iv=o,this.encrypted=!!t&&t!=="NONE",this.isCommonEncryption=this.encrypted&&t!=="AES-128"}s.clearKeyUriToKeyIdMap=function(){Qr={}};var n=s.prototype;return n.isSupported=function(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case ar:case Fr:case Be:case ir:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1},n.getDecryptData=function(t){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof t!="number"&&(this.method!=="AES-128"||this.iv||T.warn('missing IV for initialization segment with method="'+this.method+'" - compliance issue'),t=0);var e=(function(E){for(var b=new Uint8Array(16),C=12;C<16;C++)b[C]=E>>8*(15-C)&255;return b})(t);return new s(this.method,this.uri,"identity",this.keyFormatVersions,e)}var i=Bi(this.uri);if(i)switch(this.keyFormat){case Fr:this.pssh=i,i.length>=22&&(this.keyId=i.subarray(i.length-22,i.length-6));break;case Be:var a=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Yl(a,null,i);var o=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2),l=String.fromCharCode.apply(null,Array.from(o)),d=l.substring(l.indexOf("<"),l.length),h=new DOMParser().parseFromString(d,"text/xml").getElementsByTagName("KID")[0];if(h){var u=h.childNodes[0]?h.childNodes[0].nodeValue:h.getAttribute("VALUE");if(u){var f=rr(u).subarray(0,16);(function(E){var b=function(C,L,I){var S=C[L];C[L]=C[I],C[I]=S};b(E,0,3),b(E,1,2),b(E,4,5),b(E,6,7)})(f),this.keyId=f}}break;default:var p=i.subarray(0,16);if(p.length!==16){var m=new Uint8Array(16);m.set(p,16-p.length),p=m}this.keyId=p}if(!this.keyId||this.keyId.byteLength!==16){var v=Qr[this.uri];if(!v){var y=Object.keys(Qr).length%Number.MAX_SAFE_INTEGER;v=new Uint8Array(16),new DataView(v.buffer,12,4).setUint32(0,y),Qr[this.uri]=v}this.keyId=v}return this},s})(),mn=/\{\$([a-zA-Z0-9-_]+)\}/g;function vn(s){return mn.test(s)}function Nt(s,n,t){if(s.variableList!==null||s.hasVariableRefs)for(var e=t.length;e--;){var i=t[e],a=n[i];a&&(n[i]=Ri(s,a))}}function Ri(s,n){if(s.variableList!==null||s.hasVariableRefs){var t=s.variableList;return n.replace(mn,function(e){var i=e.substring(2,e.length-1),a=t?.[i];return a===void 0?(s.playlistParsingError||(s.playlistParsingError=new Error('Missing preceding EXT-X-DEFINE tag for Variable Reference: "'+i+'"')),e):a})}return n}function bn(s,n,t){var e,i,a=s.variableList;if(a||(s.variableList=a={}),"QUERYPARAM"in n){e=n.QUERYPARAM;try{var o=new self.URL(t).searchParams;if(!o.has(e))throw new Error('"'+e+'" does not match any query parameter in URI: "'+t+'"');i=o.get(e)}catch(l){s.playlistParsingError||(s.playlistParsingError=new Error("EXT-X-DEFINE QUERYPARAM: "+l.message))}}else e=n.NAME,i=n.VALUE;e in a?s.playlistParsingError||(s.playlistParsingError=new Error('EXT-X-DEFINE duplicate Variable Name declarations: "'+e+'"')):a[e]=i||""}function Gl(s,n,t){var e=n.IMPORT;if(t&&e in t){var i=s.variableList;i||(s.variableList=i={}),i[e]=t[e]}else s.playlistParsingError||(s.playlistParsingError=new Error('EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "'+e+'"'))}function Nr(){if(typeof self<"u")return self.MediaSource||self.WebKitMediaSource}var zl={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}},yn=Nr();function Mi(s,n){var t;return(t=yn?.isTypeSupported((n||"video")+'/mp4;codecs="'+s+'"'))!=null&&t}var wn=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Cn=/#EXT-X-MEDIA:(.*)/g,Vl=/^#EXT(?:INF|-X-TARGETDURATION):/m,En=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),ql=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),nr=(function(){function s(){}return s.findGroup=function(n,t){for(var e=0;e<n.length;e++){var i=n[e];if(i.id===t)return i}},s.convertAVC1ToAVCOTI=function(n){var t=n.split(".");if(t.length>2){var e=t.shift()+".";return e+=parseInt(t.shift()).toString(16),e+=("000"+parseInt(t.shift()).toString(16)).slice(-4)}return n},s.resolve=function(n,t){return he.buildAbsoluteURL(t,n,{alwaysNormalize:!0})},s.isMediaPlaylist=function(n){return Vl.test(n)},s.parseMasterPlaylist=function(n,t){var e,i={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:vn(n)},a=[];for(wn.lastIndex=0;(e=wn.exec(n))!=null;)if(e[1]){var o,l=new Ct(e[1]);Nt(i,l,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);var d=Ri(i,e[2]),h={attrs:l,bitrate:l.decimalInteger("AVERAGE-BANDWIDTH")||l.decimalInteger("BANDWIDTH"),name:l.NAME,url:s.resolve(d,t)},u=l.decimalResolution("RESOLUTION");u&&(h.width=u.width,h.height=u.height),_l((l.CODECS||"").split(/[ ,]+/).filter(function(C){return C}),h),h.videoCodec&&h.videoCodec.indexOf("avc1")!==-1&&(h.videoCodec=s.convertAVC1ToAVCOTI(h.videoCodec)),(o=h.unknownCodecs)!=null&&o.length||a.push(h),i.levels.push(h)}else if(e[3]){var f=e[3],p=e[4];switch(f){case"SESSION-DATA":var m=new Ct(p);Nt(i,m,["DATA-ID","LANGUAGE","VALUE","URI"]);var v=m["DATA-ID"];v&&(i.sessionData===null&&(i.sessionData={}),i.sessionData[v]=m);break;case"SESSION-KEY":var y=kn(p,t,i);y.encrypted&&y.isSupported()?(i.sessionKeys===null&&(i.sessionKeys=[]),i.sessionKeys.push(y)):T.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'+p+'"');break;case"DEFINE":var E=new Ct(p);Nt(i,E,["NAME","VALUE","QUERYPARAM"]),bn(i,E,t);break;case"CONTENT-STEERING":var b=new Ct(p);Nt(i,b,["SERVER-URI","PATHWAY-ID"]),i.contentSteering={uri:s.resolve(b["SERVER-URI"],t),pathwayId:b["PATHWAY-ID"]||"."};break;case"START":i.startTimeOffset=In(p)}}return i.levels=a.length>0&&a.length<i.levels.length?a:i.levels,i.levels.length===0&&(i.playlistParsingError=new Error("no levels found in manifest")),i},s.parseMasterPlaylistMedia=function(n,t,e){var i,a={},o=e.levels,l={AUDIO:o.map(function(y){return{id:y.attrs.AUDIO,audioCodec:y.audioCodec}}),SUBTITLES:o.map(function(y){return{id:y.attrs.SUBTITLES,textCodec:y.textCodec}}),"CLOSED-CAPTIONS":[]},d=0;for(Cn.lastIndex=0;(i=Cn.exec(n))!==null;){var h=new Ct(i[1]),u=h.TYPE;if(u){var f=l[u],p=a[u]||[];a[u]=p,Nt(e,h,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);var m={attrs:h,bitrate:0,id:d++,groupId:h["GROUP-ID"]||"",instreamId:h["INSTREAM-ID"],name:h.NAME||h.LANGUAGE||"",type:u,default:h.bool("DEFAULT"),autoselect:h.bool("AUTOSELECT"),forced:h.bool("FORCED"),lang:h.LANGUAGE,url:h.URI?s.resolve(h.URI,t):""};if(f!=null&&f.length){var v=s.findGroup(f,m.groupId)||f[0];Bn(m,v,"audioCodec"),Bn(m,v,"textCodec")}p.push(m)}}return a},s.parseLevelPlaylist=function(n,t,e,i,a,o){var l,d,h,u=new Ii(t),f=u.fragments,p=null,m=0,v=0,y=0,E=0,b=null,C=new er(i,t),L=-1,I=!1;for(En.lastIndex=0,u.m3u8=n,u.hasVariableRefs=vn(n);(l=En.exec(n))!==null;){I&&(I=!1,(C=new er(i,t)).start=y,C.sn=m,C.cc=E,C.level=e,p&&(C.initSegment=p,C.rawProgramDateTime=p.rawProgramDateTime,p.rawProgramDateTime=null));var S=l[1];if(S){C.duration=parseFloat(S);var R=(" "+l[2]).slice(1);C.title=R||null,C.tagList.push(R?["INF",S,R]:["INF",S])}else if(l[3]){if(Z(C.duration)){C.start=y,h&&xn(C,h,u),C.sn=m,C.level=e,C.cc=E,C.urlId=a,f.push(C);var M=(" "+l[3]).slice(1);C.relurl=Ri(u,M),Ln(C,b),b=C,y+=C.duration,m++,v=0,I=!0}}else if(l[4]){var Q=(" "+l[4]).slice(1);b?C.setByteRange(Q,b):C.setByteRange(Q)}else if(l[5])C.rawProgramDateTime=(" "+l[5]).slice(1),C.tagList.push(["PROGRAM-DATE-TIME",C.rawProgramDateTime]),L===-1&&(L=f.length);else{if(!(l=l[0].match(ql))){T.warn("No matches on slow regex match for level playlist!");continue}for(d=1;d<l.length&&l[d]===void 0;d++);var P=(" "+l[d]).slice(1),U=(" "+l[d+1]).slice(1),K=l[d+2]?(" "+l[d+2]).slice(1):"";switch(P){case"PLAYLIST-TYPE":u.type=U.toUpperCase();break;case"MEDIA-SEQUENCE":m=u.startSN=parseInt(U);break;case"SKIP":var H=new Ct(U);Nt(u,H,["RECENTLY-REMOVED-DATERANGES"]);var V=H.decimalInteger("SKIPPED-SEGMENTS");if(Z(V)){u.skippedSegments=V;for(var j=V;j--;)f.unshift(null);m+=V}var q=H.enumeratedString("RECENTLY-REMOVED-DATERANGES");q&&(u.recentlyRemovedDateranges=q.split(" "));break;case"TARGETDURATION":u.targetduration=Math.max(parseInt(U),1);break;case"VERSION":u.version=parseInt(U);break;case"EXTM3U":break;case"ENDLIST":u.live=!1;break;case"#":(U||K)&&C.tagList.push(K?[U,K]:[U]);break;case"DISCONTINUITY":E++,C.tagList.push(["DIS"]);break;case"GAP":C.gap=!0,C.tagList.push([P]);break;case"BITRATE":C.tagList.push([P,U]);break;case"DATERANGE":var W=new Ct(U);Nt(u,W,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),Nt(u,W,W.clientAttrs);var tt=new Dr(W,u.dateRanges[W.ID]);tt.isValid||u.skippedSegments?u.dateRanges[tt.id]=tt:T.warn('Ignoring invalid DATERANGE tag: "'+U+'"'),C.tagList.push(["EXT-X-DATERANGE",U]);break;case"DEFINE":var G=new Ct(U);Nt(u,G,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in G?Gl(u,G,o):bn(u,G,t);break;case"DISCONTINUITY-SEQUENCE":E=parseInt(U);break;case"KEY":var at=kn(U,t,u);if(at.isSupported()){if(at.method==="NONE"){h=void 0;break}h||(h={}),h[at.keyFormat]&&(h=pt({},h)),h[at.keyFormat]=at}else T.warn('[Keys] Ignoring invalid EXT-X-KEY tag: "'+U+'"');break;case"START":u.startTimeOffset=In(U);break;case"MAP":var nt=new Ct(U);if(Nt(u,nt,["BYTERANGE","URI"]),C.duration){var lt=new er(i,t);Sn(lt,nt,e,h),p=lt,C.initSegment=p,p.rawProgramDateTime&&!C.rawProgramDateTime&&(C.rawProgramDateTime=p.rawProgramDateTime)}else Sn(C,nt,e,h),p=C,I=!0;break;case"SERVER-CONTROL":var At=new Ct(U);u.canBlockReload=At.bool("CAN-BLOCK-RELOAD"),u.canSkipUntil=At.optionalFloat("CAN-SKIP-UNTIL",0),u.canSkipDateRanges=u.canSkipUntil>0&&At.bool("CAN-SKIP-DATERANGES"),u.partHoldBack=At.optionalFloat("PART-HOLD-BACK",0),u.holdBack=At.optionalFloat("HOLD-BACK",0);break;case"PART-INF":u.partTarget=new Ct(U).decimalFloatingPoint("PART-TARGET");break;case"PART":var St=u.partList;St||(St=u.partList=[]);var Ut=v>0?St[St.length-1]:void 0,te=v++,Yt=new Ct(U);Nt(u,Yt,["BYTERANGE","URI"]);var Jt=new ki(Yt,C,t,te,Ut);St.push(Jt),C.duration+=Jt.duration;break;case"PRELOAD-HINT":var Lt=new Ct(U);Nt(u,Lt,["URI"]),u.preloadHint=Lt;break;case"RENDITION-REPORT":var Ft=new Ct(U);Nt(u,Ft,["URI"]),u.renditionReports=u.renditionReports||[],u.renditionReports.push(Ft);break;default:T.warn("line parsed but not handled: "+l)}}}b&&!b.relurl?(f.pop(),y-=b.duration,u.partList&&(u.fragmentHint=b)):u.partList&&(Ln(C,b),C.cc=E,u.fragmentHint=C,h&&xn(C,h,u));var ee=f.length,Fe=f[0],Kt=f[ee-1];if((y+=u.skippedSegments*u.targetduration)>0&&ee&&Kt){u.averagetargetduration=y/ee;var ii=Kt.sn;u.endSN=ii!=="initSegment"?ii:0,u.live||(Kt.endList=!0),Fe&&(u.startCC=Fe.cc)}else u.endSN=0,u.startCC=0;return u.fragmentHint&&(y+=u.fragmentHint.duration),u.totalduration=y,u.endCC=E,L>0&&(function(mr,ai){for(var Ze=mr[ai],Oe=ai;Oe--;){var Pe=mr[Oe];if(!Pe)return;Pe.programDateTime=Ze.programDateTime-1e3*Pe.duration,Ze=Pe}})(f,L),u},s})();function kn(s,n,t){var e,i,a=new Ct(s);Nt(t,a,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);var o=(e=a.METHOD)!=null?e:"",l=a.URI,d=a.hexadecimalInteger("IV"),h=a.KEYFORMATVERSIONS,u=(i=a.KEYFORMAT)!=null?i:"identity";return l&&a.IV&&!d&&T.error("Invalid IV: "+a.IV),new Di(o,l?nr.resolve(l,n):"",u,(h||"1").split("/").map(Number).filter(Number.isFinite),d)}function In(s){var n=new Ct(s).decimalFloatingPoint("TIME-OFFSET");return Z(n)?n:null}function _l(s,n){["video","audio","text"].forEach(function(t){var e=s.filter(function(a){return(function(o,l){var d=zl[l];return!!d&&d[o.slice(0,4)]===!0})(a,t)});if(e.length){var i=e.filter(function(a){return a.lastIndexOf("avc1",0)===0||a.lastIndexOf("mp4a",0)===0});n[t+"Codec"]=i.length>0?i[0]:e[0],s=s.filter(function(a){return e.indexOf(a)===-1})}}),n.unknownCodecs=s}function Bn(s,n,t){var e=n[t];e&&(s[t]=e)}function Ln(s,n){s.rawProgramDateTime?s.programDateTime=Date.parse(s.rawProgramDateTime):n!=null&&n.programDateTime&&(s.programDateTime=n.endProgramDateTime),Z(s.programDateTime)||(s.programDateTime=null,s.rawProgramDateTime=null)}function Sn(s,n,t,e){s.relurl=n.URI,n.BYTERANGE&&s.setByteRange(n.BYTERANGE),s.level=t,s.sn="initSegment",e&&(s.levelkeys=e),s.initSegment=null}function xn(s,n,t){s.levelkeys=n;var e=t.encryptedFragments;e.length&&e[e.length-1].levelkeys===n||!Object.keys(n).some(function(i){return n[i].isCommonEncryption})||e.push(s)}var Ne="manifest",xe="level",oe="audioTrack",ge="subtitleTrack",ft="main",se="audio",we="subtitle";function Tn(s){switch(s.type){case oe:return se;case ge:return we;default:return ft}}function Fi(s,n){var t=s.url;return t!==void 0&&t.indexOf("data:")!==0||(t=n.url),t}var Wl=(function(){function s(t){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=t,this.registerListeners()}var n=s.prototype;return n.startLoad=function(t){},n.stopLoad=function(){this.destroyInternalLoaders()},n.registerListeners=function(){var t=this.hls;t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.LEVEL_LOADING,this.onLevelLoading,this),t.on(w.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(w.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},n.unregisterListeners=function(){var t=this.hls;t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.LEVEL_LOADING,this.onLevelLoading,this),t.off(w.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(w.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},n.createInternalLoader=function(t){var e=this.hls.config,i=e.pLoader,a=e.loader,o=new(i||a)(e);return this.loaders[t.type]=o,o},n.getInternalLoader=function(t){return this.loaders[t.type]},n.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},n.destroyInternalLoaders=function(){for(var t in this.loaders){var e=this.loaders[t];e&&e.destroy(),this.resetInternalLoader(t)}},n.destroy=function(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()},n.onManifestLoading=function(t,e){var i=e.url;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Ne,url:i,deliveryDirectives:null})},n.onLevelLoading=function(t,e){var i=e.id,a=e.level,o=e.url,l=e.deliveryDirectives;this.load({id:i,level:a,responseType:"text",type:xe,url:o,deliveryDirectives:l})},n.onAudioTrackLoading=function(t,e){var i=e.id,a=e.groupId,o=e.url,l=e.deliveryDirectives;this.load({id:i,groupId:a,level:null,responseType:"text",type:oe,url:o,deliveryDirectives:l})},n.onSubtitleTrackLoading=function(t,e){var i=e.id,a=e.groupId,o=e.url,l=e.deliveryDirectives;this.load({id:i,groupId:a,level:null,responseType:"text",type:ge,url:o,deliveryDirectives:l})},n.load=function(t){var e,i,a,o=this,l=this.hls.config,d=this.getInternalLoader(t);if(d){var h=d.context;if(h&&h.url===t.url)return void T.trace("[playlist-loader]: playlist request ongoing");T.log("[playlist-loader]: aborting previous loader for type: "+t.type),d.abort()}if(i=t.type===Ne?l.manifestLoadPolicy.default:pt({},l.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),d=this.createInternalLoader(t),(e=t.deliveryDirectives)!=null&&e.part&&(t.type===xe&&t.level!==null?a=this.hls.levels[t.level].details:t.type===oe&&t.id!==null?a=this.hls.audioTracks[t.id].details:t.type===ge&&t.id!==null&&(a=this.hls.subtitleTracks[t.id].details),a)){var u=a.partTarget,f=a.targetduration;if(u&&f){var p=1e3*Math.max(3*u,.8*f);i=pt({},i,{maxTimeToFirstByteMs:Math.min(p,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(p,i.maxTimeToFirstByteMs)})}}var m=i.errorRetry||i.timeoutRetry||{},v={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:m.maxNumRetry||0,retryDelay:m.retryDelayMs||0,maxRetryDelay:m.maxRetryDelayMs||0};d.load(t,v,{onSuccess:function(y,E,b,C){var L=o.getInternalLoader(b);o.resetInternalLoader(b.type);var I=y.data;I.indexOf("#EXTM3U")===0?(E.parsing.start=performance.now(),nr.isMediaPlaylist(I)?o.handleTrackOrLevelPlaylist(y,E,b,C||null,L):o.handleMasterPlaylist(y,E,b,C)):o.handleManifestParsingError(y,b,new Error("no EXTM3U delimiter"),C||null,E)},onError:function(y,E,b,C){o.handleNetworkError(E,b,!1,y,C)},onTimeout:function(y,E,b){o.handleNetworkError(E,b,!0,void 0,y)}})},n.handleMasterPlaylist=function(t,e,i,a){var o=this.hls,l=t.data,d=Fi(t,i),h=nr.parseMasterPlaylist(l,d);if(h.playlistParsingError)this.handleManifestParsingError(t,i,h.playlistParsingError,a,e);else{var u=h.contentSteering,f=h.levels,p=h.sessionData,m=h.sessionKeys,v=h.startTimeOffset,y=h.variableList;this.variableList=y;var E=nr.parseMasterPlaylistMedia(l,d,h),b=E.AUDIO,C=b===void 0?[]:b,L=E.SUBTITLES,I=E["CLOSED-CAPTIONS"];C.length&&(C.some(function(S){return!S.url})||!f[0].audioCodec||f[0].attrs.AUDIO||(T.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),C.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Ct({}),bitrate:0,url:""}))),o.trigger(w.MANIFEST_LOADED,{levels:f,audioTracks:C,subtitles:L,captions:I,contentSteering:u,url:d,stats:e,networkDetails:a,sessionData:p,sessionKeys:m,startTimeOffset:v,variableList:y})}},n.handleTrackOrLevelPlaylist=function(t,e,i,a,o){var l=this.hls,d=i.id,h=i.level,u=i.type,f=Fi(t,i),p=Z(d)?d:0,m=Z(h)?h:p,v=Tn(i),y=nr.parseLevelPlaylist(t.data,f,m,v,p,this.variableList);if(u===Ne){var E={attrs:new Ct({}),bitrate:0,details:y,name:"",url:f};l.trigger(w.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:f,stats:e,networkDetails:a,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}e.parsing.end=performance.now(),i.levelDetails=y,this.handlePlaylistLoaded(y,t,e,i,a,o)},n.handleManifestParsingError=function(t,e,i,a,o){this.hls.trigger(w.ERROR,{type:J.NETWORK_ERROR,details:F.MANIFEST_PARSING_ERROR,fatal:e.type===Ne,url:t.url,err:i,error:i,reason:i.message,response:t,context:e,networkDetails:a,stats:o})},n.handleNetworkError=function(t,e,i,a,o){i===void 0&&(i=!1);var l="A network "+(i?"timeout":"error"+(a?" (status "+a.code+")":""))+" occurred while loading "+t.type;t.type===xe?l+=": "+t.level+" id: "+t.id:t.type!==oe&&t.type!==ge||(l+=" id: "+t.id+' group-id: "'+t.groupId+'"');var d=new Error(l);T.warn("[playlist-loader]: "+l);var h=F.UNKNOWN,u=!1,f=this.getInternalLoader(t);switch(t.type){case Ne:h=i?F.MANIFEST_LOAD_TIMEOUT:F.MANIFEST_LOAD_ERROR,u=!0;break;case xe:h=i?F.LEVEL_LOAD_TIMEOUT:F.LEVEL_LOAD_ERROR,u=!1;break;case oe:h=i?F.AUDIO_TRACK_LOAD_TIMEOUT:F.AUDIO_TRACK_LOAD_ERROR,u=!1;break;case ge:h=i?F.SUBTITLE_TRACK_LOAD_TIMEOUT:F.SUBTITLE_LOAD_ERROR,u=!1}f&&this.resetInternalLoader(t.type);var p={type:J.NETWORK_ERROR,details:h,fatal:u,url:t.url,loader:f,context:t,error:d,networkDetails:e,stats:o};a&&(p.response=O({url:e?.url||t.url,data:void 0},a)),this.hls.trigger(w.ERROR,p)},n.handlePlaylistLoaded=function(t,e,i,a,o,l){var d=this.hls,h=a.type,u=a.level,f=a.id,p=a.groupId,m=a.deliveryDirectives,v=Fi(e,a),y=Tn(a),E=typeof a.level=="number"&&y===ft?u:void 0;if(t.fragments.length){t.targetduration||(t.playlistParsingError=new Error("Missing Target Duration"));var b=t.playlistParsingError;if(b)d.trigger(w.ERROR,{type:J.NETWORK_ERROR,details:F.LEVEL_PARSING_ERROR,fatal:!1,url:v,error:b,reason:b.message,response:e,context:a,level:E,parent:y,networkDetails:o,stats:i});else switch(t.live&&l&&(l.getCacheAge&&(t.ageHeader=l.getCacheAge()||0),l.getCacheAge&&!isNaN(t.ageHeader)||(t.ageHeader=0)),h){case Ne:case xe:d.trigger(w.LEVEL_LOADED,{details:t,level:E||0,id:f||0,stats:i,networkDetails:o,deliveryDirectives:m});break;case oe:d.trigger(w.AUDIO_TRACK_LOADED,{details:t,id:f||0,groupId:p||"",stats:i,networkDetails:o,deliveryDirectives:m});break;case ge:d.trigger(w.SUBTITLE_TRACK_LOADED,{details:t,id:f||0,groupId:p||"",stats:i,networkDetails:o,deliveryDirectives:m})}}else{var C=new Error("No Segments found in Playlist");d.trigger(w.ERROR,{type:J.NETWORK_ERROR,details:F.LEVEL_EMPTY_ERROR,fatal:!1,url:v,error:C,reason:C.message,response:e,context:a,level:E,parent:y,networkDetails:o,stats:i})}},s})();function Dn(s,n){var t;try{t=new Event("addtrack")}catch{(t=document.createEvent("Event")).initEvent("addtrack",!1,!1)}t.track=s,n.dispatchEvent(t)}function Rn(s,n){var t=s.mode;if(t==="disabled"&&(s.mode="hidden"),s.cues&&!s.cues.getCueById(n.id))try{if(s.addCue(n),!s.cues.getCueById(n.id))throw new Error("addCue is failed for: "+n)}catch(i){T.debug("[texttrack-utils]: "+i);try{var e=new self.TextTrackCue(n.startTime,n.endTime,n.text);e.id=n.id,s.addCue(e)}catch(a){T.debug("[texttrack-utils]: Legacy TextTrackCue fallback failed: "+a)}}t==="disabled"&&(s.mode=t)}function He(s){var n=s.mode;if(n==="disabled"&&(s.mode="hidden"),s.cues)for(var t=s.cues.length;t--;)s.removeCue(s.cues[t]);n==="disabled"&&(s.mode=n)}function Oi(s,n,t,e){var i=s.mode;if(i==="disabled"&&(s.mode="hidden"),s.cues&&s.cues.length>0)for(var a=(function(l,d,h){var u=[],f=(function(y,E){if(E<y[0].startTime)return 0;var b=y.length-1;if(E>y[b].endTime)return-1;for(var C=0,L=b;C<=L;){var I=Math.floor((L+C)/2);if(E<y[I].startTime)L=I-1;else{if(!(E>y[I].startTime&&C<b))return I;C=I+1}}return y[C].startTime-E<E-y[L].startTime?C:L})(l,d);if(f>-1)for(var p=f,m=l.length;p<m;p++){var v=l[p];if(v.startTime>=d&&v.endTime<=h)u.push(v);else if(v.startTime>h)return u}return u})(s.cues,n,t),o=0;o<a.length;o++)e&&!e(a[o])||s.removeCue(a[o]);i==="disabled"&&(s.mode=i)}var or="org.id3",Xl="com.apple.quicktime.HLS",sr="https://aomedia.org/emsg/ID3";function Pi(){if(typeof self<"u")return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}var Hr=(function(){var s=Pi();try{new s(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();function Ui(s,n){return s.getTime()/1e3-n}var Zl=(function(){function s(t){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=t,this._registerListeners()}var n=s.prototype;return n.destroy=function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null},n._registerListeners=function(){var t=this.hls;t.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.on(w.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(w.LEVEL_UPDATED,this.onLevelUpdated,this)},n._unregisterListeners=function(){var t=this.hls;t.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),t.off(w.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(w.LEVEL_UPDATED,this.onLevelUpdated,this)},n.onMediaAttached=function(t,e){this.media=e.media},n.onMediaDetaching=function(){this.id3Track&&(He(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})},n.onManifestLoading=function(){this.dateRangeCuesAppended={}},n.createTrack=function(t){var e=this.getID3Track(t.textTracks);return e.mode="hidden",e},n.getID3Track=function(t){if(this.media){for(var e=0;e<t.length;e++){var i=t[e];if(i.kind==="metadata"&&i.label==="id3")return Dn(i,this.media),i}return this.media.addTextTrack("metadata","id3")}},n.onFragParsingMetadata=function(t,e){if(this.media){var i=this.hls.config,a=i.enableEmsgMetadataCues,o=i.enableID3MetadataCues;if(a||o){var l=e.samples;this.id3Track||(this.id3Track=this.createTrack(this.media));for(var d=Pi(),h=0;h<l.length;h++){var u=l[h].type;if((u!==sr||a)&&o){var f=ln(l[h].data);if(f){var p=l[h].pts,m=p+l[h].duration;m>Hr&&(m=Hr),m-p<=0&&(m=p+.25);for(var v=0;v<f.length;v++){var y=f[v];if(!sn(y)){this.updateId3CueEnds(p,u);var E=new d(p,m,"");E.value=y,u&&(E.type=u),this.id3Track.addCue(E)}}}}}}}},n.updateId3CueEnds=function(t,e){var i,a=(i=this.id3Track)==null?void 0:i.cues;if(a)for(var o=a.length;o--;){var l=a[o];l.type===e&&l.startTime<t&&l.endTime===Hr&&(l.endTime=t)}},n.onBufferFlushing=function(t,e){var i=e.startOffset,a=e.endOffset,o=e.type,l=this.id3Track,d=this.hls;if(d){var h=d.config,u=h.enableEmsgMetadataCues,f=h.enableID3MetadataCues;l&&(u||f)&&Oi(l,i,a,o==="audio"?function(p){return p.type===or&&f}:o==="video"?function(p){return p.type===sr&&u}:function(p){return p.type===or&&f||p.type===sr&&u})}},n.onLevelUpdated=function(t,e){var i=this,a=e.details;if(this.media&&a.hasProgramDateTime&&this.hls.config.enableDateRangeMetadataCues){var o=this.dateRangeCuesAppended,l=this.id3Track,d=a.dateRanges,h=Object.keys(d);if(l)for(var u=Object.keys(o).filter(function(C){return!h.includes(C)}),f=function(){var C=u[p];Object.keys(o[C].cues).forEach(function(L){l.removeCue(o[C].cues[L])}),delete o[C]},p=u.length;p--;)f();var m=a.fragments[a.fragments.length-1];if(h.length!==0&&Z(m?.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(var v=m.programDateTime/1e3-m.start,y=Pi(),E=function(){var C=h[b],L=d[C],I=o[C],S=I?.cues||{},R=I?.durationKnown||!1,M=Ui(L.startDate,v),Q=Hr,P=L.endDate;if(P)Q=Ui(P,v),R=!0;else if(L.endOnNext&&!R){var U=h.reduce(function(G,at){var nt=d[at];return nt.class===L.class&&nt.id!==at&&nt.startDate>L.startDate&&G.push(nt),G},[]).sort(function(G,at){return G.startDate.getTime()-at.startDate.getTime()})[0];U&&(Q=Ui(U.startDate,v),R=!0)}for(var K,H,V=Object.keys(L.attr),j=0;j<V.length;j++){var q=V[j];if((H=q)!=="ID"&&H!=="CLASS"&&H!=="START-DATE"&&H!=="DURATION"&&H!=="END-DATE"&&H!=="END-ON-NEXT"){var W=S[q];if(W)R&&!I.durationKnown&&(W.endTime=Q);else{var tt=L.attr[q];W=new y(M,Q,""),Ei(q)&&(K=tt,tt=Uint8Array.from(K.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer),W.value={key:q,data:tt},W.type=Xl,W.id=C,i.id3Track.addCue(W),S[q]=W}}}o[C]={cues:S,dateRange:L,durationKnown:R}},b=0;b<h.length;b++)E()}}},s})(),Jl=(function(){function s(t){var e=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return e.timeupdate()},this.hls=t,this.config=t.config,this.registerListeners()}var n=s.prototype;return n.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},n.registerListeners=function(){this.hls.on(w.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(w.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(w.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(w.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(w.ERROR,this.onError,this)},n.unregisterListeners=function(){this.hls.off(w.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(w.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(w.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(w.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(w.ERROR,this.onError,this)},n.onMediaAttached=function(t,e){this.media=e.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},n.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},n.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},n.onLevelUpdated=function(t,e){var i=e.details;this.levelDetails=i,i.advanced&&this.timeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},n.onError=function(t,e){var i;e.details===F.BUFFER_STALLED_ERROR&&(this.stallCount++,(i=this.levelDetails)!=null&&i.live&&T.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},n.timeupdate=function(){var t=this.media,e=this.levelDetails;if(t&&e){this.currentTime=t.currentTime;var i=this.computeLatency();if(i!==null){this._latency=i;var a=this.config,o=a.lowLatencyMode,l=a.maxLiveSyncPlaybackRate;if(o&&l!==1){var d=this.targetLatency;if(d!==null){var h=i-d,u=h<Math.min(this.maxLatency,d+e.targetduration);if(e.live&&u&&h>.05&&this.forwardBufferLength>1){var f=Math.min(2,Math.max(1,l)),p=Math.round(2/(1+Math.exp(-.75*h-this.edgeStalled))*20)/20;t.playbackRate=Math.min(f,Math.max(1,p))}else t.playbackRate!==1&&t.playbackRate!==0&&(t.playbackRate=1)}}}}},n.estimateLiveEdge=function(){var t=this.levelDetails;return t===null?null:t.edge+t.age},n.computeLatency=function(){var t=this.estimateLiveEdge();return t===null?null:t-this.currentTime},X(s,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var t=this.config,e=this.levelDetails;return t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:e?t.liveMaxLatencyDurationCount*e.targetduration:0}},{key:"targetLatency",get:function(){var t=this.levelDetails;if(t===null)return null;var e=t.holdBack,i=t.partHoldBack,a=t.targetduration,o=this.config,l=o.liveSyncDuration,d=o.liveSyncDurationCount,h=o.lowLatencyMode,u=this.hls.userConfig,f=h&&i||e;(u.liveSyncDuration||u.liveSyncDurationCount||f===0)&&(f=l!==void 0?l:d*a);var p=a;return f+Math.min(1*this.stallCount,p)}},{key:"liveSyncPosition",get:function(){var t=this.estimateLiveEdge(),e=this.targetLatency,i=this.levelDetails;if(t===null||e===null||i===null)return null;var a=i.edge,o=t-e-this.edgeStalled,l=a-i.totalduration,d=a-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(l,o),d)}},{key:"drift",get:function(){var t=this.levelDetails;return t===null?1:t.drift}},{key:"edgeStalled",get:function(){var t=this.levelDetails;if(t===null)return 0;var e=3*(this.config.lowLatencyMode&&t.partTarget||t.targetduration);return Math.max(t.age-e,0)}},{key:"forwardBufferLength",get:function(){var t=this.media,e=this.levelDetails;if(!t||!e)return 0;var i=t.buffered.length;return(i?t.buffered.end(i-1):e.edge)-this.currentTime}}]),s})(),Qi=["NONE","TYPE-0","TYPE-1",null],Ni="",jl="YES",$l="v2",Mn=(function(){function s(n,t,e){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=n,this.part=t,this.skip=e}return s.prototype.addDirectives=function(n){var t=new self.URL(n);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href},s})(),lr=(function(){function s(n){this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[n.url],this._attrs=[n.attrs],this.bitrate=n.bitrate,n.details&&(this.details=n.details),this.id=n.id||0,this.name=n.name,this.width=n.width||0,this.height=n.height||0,this.audioCodec=n.audioCodec,this.videoCodec=n.videoCodec,this.unknownCodecs=n.unknownCodecs,this.codecSet=[n.videoCodec,n.audioCodec].filter(function(t){return t}).join(",").replace(/\.[^.,]+/g,"")}return s.prototype.addFallback=function(n){this.url.push(n.url),this._attrs.push(n.attrs)},X(s,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"attrs",get:function(){return this._attrs[this._urlId]}},{key:"pathwayId",get:function(){return this.attrs["PATHWAY-ID"]||"."}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(n){var t=n%this.url.length;this._urlId!==t&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=t)}},{key:"audioGroupId",get:function(){var n;return(n=this.audioGroupIds)==null?void 0:n[this.urlId]}},{key:"textGroupId",get:function(){var n;return(n=this.textGroupIds)==null?void 0:n[this.urlId]}}]),s})();function Hi(s,n){var t=n.startPTS;if(Z(t)){var e,i=0;n.sn>s.sn?(i=t-s.start,e=s):(i=s.start-t,e=n),e.duration!==i&&(e.duration=i)}else n.sn>s.sn?s.cc===n.cc&&s.minEndPTS?n.start=s.start+(s.minEndPTS-s.start):n.start=s.start+s.duration:n.start=Math.max(s.start-n.duration,0)}function Fn(s,n,t,e,i,a){e-t<=0&&(T.warn("Fragment should have a positive duration",n),e=t+n.duration,a=i+n.duration);var o=t,l=e,d=n.startPTS,h=n.endPTS;if(Z(d)){var u=Math.abs(d-t);Z(n.deltaPTS)?n.deltaPTS=Math.max(u,n.deltaPTS):n.deltaPTS=u,o=Math.max(t,d),t=Math.min(t,d),i=Math.min(i,n.startDTS),l=Math.min(e,h),e=Math.max(e,h),a=Math.max(a,n.endDTS)}var f=t-n.start;n.start!==0&&(n.start=t),n.duration=e-n.start,n.startPTS=t,n.maxStartPTS=o,n.startDTS=i,n.endPTS=e,n.minEndPTS=l,n.endDTS=a;var p,m=n.sn;if(!s||m<s.startSN||m>s.endSN)return 0;var v=m-s.startSN,y=s.fragments;for(y[v]=n,p=v;p>0;p--)Hi(y[p],y[p-1]);for(p=v;p<y.length-1;p++)Hi(y[p],y[p+1]);return s.fragmentHint&&Hi(y[y.length-1],s.fragmentHint),s.PTSKnown=s.alignedSliding=!0,f}function tc(s,n){for(var t=null,e=s.fragments,i=e.length-1;i>=0;i--){var a=e[i].initSegment;if(a){t=a;break}}s.fragmentHint&&delete s.fragmentHint.endPTS;var o,l,d,h,u,f=0;if((function(b,C,L){for(var I=C.skippedSegments,S=Math.max(b.startSN,C.startSN)-C.startSN,R=(b.fragmentHint?1:0)+(I?C.endSN:Math.min(b.endSN,C.endSN))-C.startSN,M=C.startSN-b.startSN,Q=C.fragmentHint?C.fragments.concat(C.fragmentHint):C.fragments,P=b.fragmentHint?b.fragments.concat(b.fragmentHint):b.fragments,U=S;U<=R;U++){var K=P[M+U],H=Q[U];I&&!H&&U<I&&(H=C.fragments[U]=K),K&&H&&L(K,H)}})(s,n,function(b,C){b.relurl&&(f=b.cc-C.cc),Z(b.startPTS)&&Z(b.endPTS)&&(C.start=C.startPTS=b.startPTS,C.startDTS=b.startDTS,C.maxStartPTS=b.maxStartPTS,C.endPTS=b.endPTS,C.endDTS=b.endDTS,C.minEndPTS=b.minEndPTS,C.duration=b.endPTS-b.startPTS,C.duration&&(o=C),n.PTSKnown=n.alignedSliding=!0),C.elementaryStreams=b.elementaryStreams,C.loader=b.loader,C.stats=b.stats,C.urlId=b.urlId,b.initSegment&&(C.initSegment=b.initSegment,t=b.initSegment)}),t&&(n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments).forEach(function(b){var C;b.initSegment&&b.initSegment.relurl!==((C=t)==null?void 0:C.relurl)||(b.initSegment=t)}),n.skippedSegments)if(n.deltaUpdateFailed=n.fragments.some(function(b){return!b}),n.deltaUpdateFailed){T.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var p=n.skippedSegments;p--;)n.fragments.shift();n.startSN=n.fragments[0].sn,n.startCC=n.fragments[0].cc}else n.canSkipDateRanges&&(n.dateRanges=(l=s.dateRanges,d=n.dateRanges,h=n.recentlyRemovedDateranges,u=pt({},l),h&&h.forEach(function(b){delete u[b]}),Object.keys(d).forEach(function(b){var C=new Dr(d[b].attr,u[b]);C.isValid?u[b]=C:T.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'+JSON.stringify(d[b].attr)+'"')}),u));var m=n.fragments;if(f){T.warn("discontinuity sliding from playlist, take drift into account");for(var v=0;v<m.length;v++)m[v].cc+=f}n.skippedSegments&&(n.startCC=n.fragments[0].cc),(function(b,C,L){if(b&&C)for(var I=0,S=0,R=b.length;S<=R;S++){var M=b[S],Q=C[S+I];M&&Q&&M.index===Q.index&&M.fragment.sn===Q.fragment.sn?L(M,Q):I--}})(s.partList,n.partList,function(b,C){C.elementaryStreams=b.elementaryStreams,C.stats=b.stats}),o?Fn(n,o,o.startPTS,o.endPTS,o.startDTS,o.endDTS):On(s,n),m.length&&(n.totalduration=n.edge-m[0].start),n.driftStartTime=s.driftStartTime,n.driftStart=s.driftStart;var y=n.advancedDateTime;if(n.advanced&&y){var E=n.edge;n.driftStart||(n.driftStartTime=y,n.driftStart=E),n.driftEndTime=y,n.driftEnd=E}else n.driftEndTime=s.driftEndTime,n.driftEnd=s.driftEnd,n.advancedDateTime=s.advancedDateTime}function On(s,n){var t=n.startSN+n.skippedSegments-s.startSN,e=s.fragments;t<0||t>=e.length||Ki(n,e[t].start)}function Ki(s,n){if(n){for(var t=s.fragments,e=s.skippedSegments;e<t.length;e++)t[e].start+=n;s.fragmentHint&&(s.fragmentHint.start+=n)}}function Pn(s,n,t){var e;return s!=null&&s.details?Un((e=s.details)==null?void 0:e.partList,n,t):null}function Un(s,n,t){if(s)for(var e=s.length;e--;){var i=s[e];if(i.index===t&&i.fragment.sn===n)return i}return null}function Kr(s){switch(s.details){case F.FRAG_LOAD_TIMEOUT:case F.KEY_LOAD_TIMEOUT:case F.LEVEL_LOAD_TIMEOUT:case F.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Qn(s,n){var t=Kr(n);return s.default[(t?"timeout":"error")+"Retry"]}function Yi(s,n){var t=s.backoff==="linear"?1:Math.pow(2,n);return Math.min(t*s.retryDelayMs,s.maxRetryDelayMs)}function Nn(s){return O(O({},s),{errorRetry:null,timeoutRetry:null})}function Yr(s,n,t,e){return!!s&&n<s.maxNumRetry&&((function(i){return i===0&&navigator.onLine===!1||!!i&&(i<400||i>499)})(e)||!!t)}var Hn=function(s,n){for(var t=0,e=s.length-1,i=null,a=null;t<=e;){var o=n(a=s[i=(t+e)/2|0]);if(o>0)t=i+1;else{if(!(o<0))return a;e=i-1}}return null};function cr(s,n,t,e){t===void 0&&(t=0),e===void 0&&(e=0);var i=null;if(s?i=n[s.sn-n[0].sn+1]||null:t===0&&n[0].start===0&&(i=n[0]),i&&Gi(t,e,i)===0)return i;var a=Hn(n,Gi.bind(null,t,e));return!a||a===s&&i?i:a}function Gi(s,n,t){if(s===void 0&&(s=0),n===void 0&&(n=0),t.start<=s&&t.start+t.duration>s)return 0;var e=Math.min(n,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-e<=s?1:t.start-e>s&&t.start?-1:0}function ec(s,n,t){var e=1e3*Math.min(n,t.duration+(t.deltaPTS?t.deltaPTS:0));return(t.endProgramDateTime||0)-e>s}var zi,rc=3e5,Vi=0,fe=2,Gr=5,Ke=0,zr=1,Kn=2,ic=(function(){function s(t){this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=t,this.log=T.log.bind(T,"[info]:"),this.warn=T.warn.bind(T,"[warning]:"),this.error=T.error.bind(T,"[error]:"),this.registerListeners()}var n=s.prototype;return n.registerListeners=function(){var t=this.hls;t.on(w.ERROR,this.onError,this),t.on(w.MANIFEST_LOADING,this.onManifestLoading,this),t.on(w.LEVEL_UPDATED,this.onLevelUpdated,this)},n.unregisterListeners=function(){var t=this.hls;t&&(t.off(w.ERROR,this.onError,this),t.off(w.ERROR,this.onErrorOut,this),t.off(w.MANIFEST_LOADING,this.onManifestLoading,this),t.off(w.LEVEL_UPDATED,this.onLevelUpdated,this))},n.destroy=function(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}},n.startLoad=function(t){this.playlistError=0},n.stopLoad=function(){},n.getVariantLevelIndex=function(t){return t?.type===ft?t.level:this.hls.loadLevel},n.onManifestLoading=function(){this.playlistError=0,this.penalizedRenditions={}},n.onLevelUpdated=function(){this.playlistError=0},n.onError=function(t,e){var i,a;if(!e.fatal){var o=this.hls,l=e.context;switch(e.details){case F.FRAG_LOAD_ERROR:case F.FRAG_LOAD_TIMEOUT:case F.KEY_LOAD_ERROR:case F.KEY_LOAD_TIMEOUT:e.errorAction=this.getFragRetryOrSwitchAction(e);return;case F.FRAG_PARSING_ERROR:if((i=e.frag)!=null&&i.gap)return void(e.errorAction={action:Vi,flags:Ke});case F.FRAG_GAP:case F.FRAG_DECRYPT_ERROR:e.errorAction=this.getFragRetryOrSwitchAction(e),e.errorAction.action=fe;return;case F.LEVEL_EMPTY_ERROR:case F.LEVEL_PARSING_ERROR:var d,h,u=e.parent===ft?e.level:o.loadLevel;e.details===F.LEVEL_EMPTY_ERROR&&(d=e.context)!=null&&(h=d.levelDetails)!=null&&h.live?e.errorAction=this.getPlaylistRetryOrSwitchAction(e,u):(e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,u));return;case F.LEVEL_LOAD_ERROR:case F.LEVEL_LOAD_TIMEOUT:typeof l?.level=="number"&&(e.errorAction=this.getPlaylistRetryOrSwitchAction(e,l.level));return;case F.AUDIO_TRACK_LOAD_ERROR:case F.AUDIO_TRACK_LOAD_TIMEOUT:case F.SUBTITLE_LOAD_ERROR:case F.SUBTITLE_TRACK_LOAD_TIMEOUT:if(l){var f=o.levels[o.loadLevel];if(f&&(l.type===oe&&l.groupId===f.audioGroupId||l.type===ge&&l.groupId===f.textGroupId))return e.errorAction=this.getPlaylistRetryOrSwitchAction(e,o.loadLevel),e.errorAction.action=fe,void(e.errorAction.flags=zr)}return;case F.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:var p=o.levels[o.loadLevel],m=p?.attrs["HDCP-LEVEL"];m&&(e.errorAction={action:fe,flags:Kn,hdcpLevel:m});return;case F.BUFFER_ADD_CODEC_ERROR:case F.REMUX_ALLOC_ERROR:e.errorAction=this.getLevelSwitchAction(e,(a=e.level)!=null?a:o.loadLevel);return;case F.INTERNAL_EXCEPTION:case F.BUFFER_APPENDING_ERROR:case F.BUFFER_APPEND_ERROR:case F.BUFFER_FULL_ERROR:case F.LEVEL_SWITCH_ERROR:case F.BUFFER_STALLED_ERROR:case F.BUFFER_SEEK_OVER_HOLE:case F.BUFFER_NUDGE_ON_STALL:e.errorAction={action:Vi,flags:Ke};return}if(e.type===J.KEY_SYSTEM_ERROR){var v=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,v);return}}},n.getPlaylistRetryOrSwitchAction=function(t,e){var i,a=Qn(this.hls.config.playlistLoadPolicy,t),o=this.playlistError++,l=(i=t.response)==null?void 0:i.code;if(Yr(a,o,Kr(t),l))return{action:Gr,flags:Ke,retryConfig:a,retryCount:o};var d=this.getLevelSwitchAction(t,e);return a&&(d.retryConfig=a,d.retryCount=o),d},n.getFragRetryOrSwitchAction=function(t){var e=this.hls,i=this.getVariantLevelIndex(t.frag),a=e.levels[i],o=e.config,l=o.fragLoadPolicy,d=o.keyLoadPolicy,h=Qn(t.details.startsWith("key")?d:l,t),u=e.levels.reduce(function(v,y){return v+y.fragmentError},0);if(a){var f;t.details!==F.FRAG_GAP&&a.fragmentError++;var p=(f=t.response)==null?void 0:f.code;if(Yr(h,u,Kr(t),p))return{action:Gr,flags:Ke,retryConfig:h,retryCount:u}}var m=this.getLevelSwitchAction(t,i);return h&&(m.retryConfig=h,m.retryCount=u),m},n.getLevelSwitchAction=function(t,e){var i=this.hls;e??=i.loadLevel;var a=this.hls.levels[e];if(a&&(a.loadError++,i.autoLevelEnabled)){for(var o,l,d=-1,h=i.levels,u=i.loadLevel,f=i.minAutoLevel,p=i.maxAutoLevel,m=(o=t.frag)==null?void 0:o.type,v=(l=t.context)!=null?l:{},y=v.type,E=v.groupId,b=h.length;b--;){var C=(b+u)%h.length;if(C!==u&&C>=f&&C<=p&&h[C].loadError===0){var L=h[C];if(t.details===F.FRAG_GAP&&t.frag){var I=h[C].details;if(I){var S=cr(t.frag,I.fragments,t.frag.start);if(S!=null&&S.gap)continue}}else if(y===oe&&E===L.audioGroupId||y===ge&&E===L.textGroupId||m===se&&a.audioGroupId===L.audioGroupId||m===we&&a.textGroupId===L.textGroupId)continue;d=C;break}}if(d>-1&&i.loadLevel!==d)return t.levelRetry=!0,this.playlistError=0,{action:fe,flags:Ke,nextAutoLevel:d}}return{action:fe,flags:zr}},n.onErrorOut=function(t,e){var i;switch((i=e.errorAction)==null?void 0:i.action){case Vi:break;case fe:this.sendAlternateToPenaltyBox(e),e.errorAction.resolved||e.details===F.FRAG_GAP||(e.fatal=!0)}e.fatal&&this.hls.stopLoad()},n.sendAlternateToPenaltyBox=function(t){var e=this.hls,i=t.errorAction;if(i){var a=i.flags,o=i.hdcpLevel,l=i.nextAutoLevel;switch(a){case Ke:this.switchLevel(t,l);break;case zr:i.resolved||(i.resolved=this.redundantFailover(t));break;case Kn:o&&(e.maxHdcpLevel=Qi[Qi.indexOf(o)-1],i.resolved=!0),this.warn('Restricting playback to HDCP-LEVEL of "'+e.maxHdcpLevel+'" or lower')}i.resolved||this.switchLevel(t,l)}},n.switchLevel=function(t,e){e!==void 0&&t.errorAction&&(this.warn("switching to level "+e+" after "+t.details),this.hls.nextAutoLevel=e,t.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)},n.redundantFailover=function(t){var e=this,i=this.hls,a=this.penalizedRenditions,o=t.parent===ft?t.level:i.loadLevel,l=i.levels[o],d=l.url.length,h=t.frag?t.frag.urlId:l.urlId;l.urlId!==h||t.frag&&!l.details||this.penalizeRendition(l,t);for(var u=function(){var m=(h+f)%d,v=a[m];if(!v||(function(y,E,b){if(performance.now()-y.lastErrorPerfMs>rc)return!0;var C=y.details;if(E.details===F.FRAG_GAP&&C&&E.frag){var L=E.frag.start,I=cr(null,C.fragments,L);if(I&&!I.gap)return!0}if(b&&y.errors.length<b.errors.length){var S=y.errors[y.errors.length-1];if(C&&S.frag&&E.frag&&Math.abs(S.frag.start-E.frag.start)>3*C.targetduration)return!0}return!1})(v,t,a[h]))return e.warn("Switching to Redundant Stream "+(m+1)+"/"+d+': "'+l.url[m]+'" after '+t.details),e.playlistError=0,i.levels.forEach(function(y){y.urlId=m}),i.nextLoadLevel=o,{v:!0}},f=1;f<d;f++){var p=u();if(typeof p=="object")return p.v}return!1},n.penalizeRendition=function(t,e){var i=this.penalizedRenditions,a=i[t.urlId]||{lastErrorPerfMs:0,errors:[],details:void 0};a.lastErrorPerfMs=performance.now(),a.errors.push(e),a.details=t.details,i[t.urlId]=a},s})(),qi=(function(){function s(t,e){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=T.log.bind(T,e+":"),this.warn=T.warn.bind(T,e+":"),this.hls=t}var n=s.prototype;return n.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},n.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},n.startLoad=function(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()},n.stopLoad=function(){this.canLoad=!1,this.clearTimer()},n.switchParams=function(t,e){var i=e?.renditionReports;if(i){for(var a=-1,o=0;o<i.length;o++){var l=i[o],d=void 0;try{d=new self.URL(l.URI,e.url).href}catch(m){T.warn("Could not construct new URL for Rendition Report: "+m),d=l.URI||""}if(d===t){a=o;break}d===t.substring(0,d.length)&&(a=o)}if(a!==-1){var h=i[a],u=parseInt(h["LAST-MSN"])||e?.lastPartSn,f=parseInt(h["LAST-PART"])||e?.lastPartIndex;if(this.hls.config.lowLatencyMode){var p=Math.min(e.age-e.partTarget,e.targetduration);f>=0&&p>e.partTarget&&(f+=1)}return new Mn(u,f>=0?f:void 0,Ni)}}},n.loadPlaylist=function(t){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())},n.shouldLoadPlaylist=function(t){return this.canLoad&&!!t&&!!t.url&&(!t.details||t.details.live)},n.shouldReloadPlaylist=function(t){return this.timer===-1&&this.requestScheduled===-1&&this.shouldLoadPlaylist(t)},n.playlistLoaded=function(t,e,i){var a=this,o=e.details,l=e.stats,d=self.performance.now(),h=l.loading.first?Math.max(0,d-l.loading.first):0;if(o.advancedDateTime=Date.now()-h,o.live||i!=null&&i.live){if(o.reloaded(i),i&&this.log("live playlist "+t+" "+(o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:o.updated?"UPDATED":"MISSED")),i&&o.fragments.length>0&&tc(i,o),!this.canLoad||!o.live)return;var u,f=void 0,p=void 0;if(o.canBlockReload&&o.endSN&&o.advanced){var m=this.hls.config.lowLatencyMode,v=o.lastPartSn,y=o.endSN,E=o.lastPartIndex,b=v===y;E!==-1?(f=b?y+1:v,p=b?m?0:E:E+1):f=y+1;var C=o.age,L=C+o.ageHeader,I=Math.min(L-o.partTarget,1.5*o.targetduration);if(I>0){if(i&&I>i.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+i.tuneInGoal+" to: "+I+" with playlist age: "+o.age),I=0;else{var S=Math.floor(I/o.targetduration);f+=S,p!==void 0&&(p+=Math.round(I%o.targetduration/o.partTarget)),this.log("CDN Tune-in age: "+o.ageHeader+"s last advanced "+C.toFixed(2)+"s goal: "+I+" skip sn "+S+" to part "+p)}o.tuneInGoal=I}if(u=this.getDeliveryDirectives(o,e.deliveryDirectives,f,p),m||!b)return void this.loadPlaylist(u)}else(o.canBlockReload||o.canSkipUntil)&&(u=this.getDeliveryDirectives(o,e.deliveryDirectives,f,p));var R=this.hls.mainForwardBufferInfo,M=R?R.end-R.len:0,Q=(function(U,K){K===void 0&&(K=1/0);var H=1e3*U.targetduration;if(U.updated){var V=U.fragments;if(V.length&&4*H>K){var j=1e3*V[V.length-1].duration;j<H&&(H=j)}}else H/=2;return Math.round(H)})(o,1e3*(o.edge-M));o.updated&&d>this.requestScheduled+Q&&(this.requestScheduled=l.loading.start),f!==void 0&&o.canBlockReload?this.requestScheduled=l.loading.first+Q-(1e3*o.partTarget||1e3):this.requestScheduled===-1||this.requestScheduled+Q<d?this.requestScheduled=d:this.requestScheduled-d<=0&&(this.requestScheduled+=Q);var P=this.requestScheduled-d;P=Math.max(0,P),this.log("reload live playlist "+t+" in "+Math.round(P)+" ms"),this.timer=self.setTimeout(function(){return a.loadPlaylist(u)},P)}else this.clearTimer()},n.getDeliveryDirectives=function(t,e,i,a){var o=(function(l,d){var h=l.canSkipUntil,u=l.canSkipDateRanges,f=l.endSN;return h&&(d!==void 0?d-f:0)<h?u?$l:jl:Ni})(t,i);return e!=null&&e.skip&&t.deltaUpdateFailed&&(i=e.msn,a=e.part,o=Ni),new Mn(i,a,o)},n.checkRetry=function(t){var e=this,i=t.details,a=Kr(t),o=t.errorAction,l=o||{},d=l.action,h=l.retryCount,u=h===void 0?0:h,f=l.retryConfig,p=!!o&&!!f&&(d===Gr||!o.resolved&&d===fe);if(p){var m;if(this.requestScheduled=-1,u>=f.maxNumRetry)return!1;if(a&&(m=t.context)!=null&&m.deliveryDirectives)this.warn("Retrying playlist loading "+(u+1)+"/"+f.maxNumRetry+' after "'+i+'" without delivery-directives'),this.loadPlaylist();else{var v=Yi(f,u);this.timer=self.setTimeout(function(){return e.loadPlaylist()},v),this.warn("Retrying playlist loading "+(u+1)+"/"+f.maxNumRetry+' after "'+i+'" in '+v+"ms")}t.levelRetry=!0,o.resolved=!0}return p},s})(),ac=(function(s){function n(e,i){var a;return(a=s.call(this,e,"[level-controller]")||this)._levels=[],a._firstLevel=-1,a._startLevel=void 0,a.currentLevel=null,a.currentLevelIndex=-1,a.manualLevelIndex=-1,a.steering=void 0,a.onParsedComplete=void 0,a.steering=i,a._registerListeners(),a}Et(n,s);var t=n.prototype;return t._registerListeners=function(){var e=this.hls;e.on(w.MANIFEST_LOADING,this.onManifestLoading,this),e.on(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(w.LEVEL_LOADED,this.onLevelLoaded,this),e.on(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(w.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(w.FRAG_LOADED,this.onFragLoaded,this),e.on(w.ERROR,this.onError,this)},t._unregisterListeners=function(){var e=this.hls;e.off(w.MANIFEST_LOADING,this.onManifestLoading,this),e.off(w.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(w.LEVEL_LOADED,this.onLevelLoaded,this),e.off(w.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(w.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(w.FRAG_LOADED,this.onFragLoaded,this),e.off(w.ERROR,this.onError,this)},t.destroy=function(){this._unregisterListeners(),this.steering=null,this.resetLevels(),s.prototype.destroy.call(this)},t.startLoad=function(){this._levels.forEach(function(e){e.loadError=0,e.fragmentError=0}),s.prototype.startLoad.call(this)},t.resetLevels=function(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]},t.onManifestLoading=function(e,i){this.resetLevels()},t.onManifestLoaded=function(e,i){var a,o=[],l={};i.levels.forEach(function(d){var h,u=d.attrs;((h=d.audioCodec)==null?void 0:h.indexOf("mp4a.40.34"))!==-1&&(zi||(zi=/chrome|firefox/i.test(navigator.userAgent)),zi&&(d.audioCodec=void 0));var f=u.AUDIO,p=u.CODECS,m=u["FRAME-RATE"],v=u["PATHWAY-ID"],y=u.RESOLUTION,E=u.SUBTITLES,b=(v||".")+"-"+d.bitrate+"-"+y+"-"+m+"-"+p;(a=l[b])?a.addFallback(d):(a=new lr(d),l[b]=a,o.push(a)),Vr(a,"audio",f),Vr(a,"text",E)}),this.filterAndSortMediaOptions(o,i)},t.filterAndSortMediaOptions=function(e,i){var a=this,o=[],l=[],d=!1,h=!1,u=!1,f=e.filter(function(C){var L=C.audioCodec,I=C.videoCodec,S=C.width,R=C.height,M=C.unknownCodecs;return d||(d=!(!S||!R)),h||(h=!!I),u||(u=!!L),!(M!=null&&M.length)&&(!L||Mi(L,"audio"))&&(!I||Mi(I,"video"))});if((d||h)&&u&&(f=f.filter(function(C){var L=C.videoCodec,I=C.width,S=C.height;return!!L||!(!I||!S)})),f.length!==0){i.audioTracks&&Yn(o=i.audioTracks.filter(function(C){return!C.audioCodec||Mi(C.audioCodec,"audio")})),i.subtitles&&Yn(l=i.subtitles);var p=f.slice(0);f.sort(function(C,L){return C.attrs["HDCP-LEVEL"]!==L.attrs["HDCP-LEVEL"]?(C.attrs["HDCP-LEVEL"]||"")>(L.attrs["HDCP-LEVEL"]||"")?1:-1:C.bitrate!==L.bitrate?C.bitrate-L.bitrate:C.attrs["FRAME-RATE"]!==L.attrs["FRAME-RATE"]?C.attrs.decimalFloatingPoint("FRAME-RATE")-L.attrs.decimalFloatingPoint("FRAME-RATE"):C.attrs.SCORE!==L.attrs.SCORE?C.attrs.decimalFloatingPoint("SCORE")-L.attrs.decimalFloatingPoint("SCORE"):d&&C.height!==L.height?C.height-L.height:0});var m=p[0];if(this.steering&&(f=this.steering.filterParsedLevels(f)).length!==p.length){for(var v=0;v<p.length;v++)if(p[v].pathwayId===f[0].pathwayId){m=p[v];break}}this._levels=f;for(var y=0;y<f.length;y++)if(f[y]===m){this._firstLevel=y,this.log("manifest loaded, "+f.length+" level(s) found, first bitrate: "+m.bitrate);break}var E=u&&!h,b={levels:f,audioTracks:o,subtitleTracks:l,sessionData:i.sessionData,sessionKeys:i.sessionKeys,firstLevel:this._firstLevel,stats:i.stats,audio:u,video:h,altAudio:!E&&o.some(function(C){return!!C.url})};this.hls.trigger(w.MANIFEST_PARSED,b),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else Promise.resolve().then(function(){if(a.hls){var C=new Error("no level with compatible codecs found in manifest");a.hls.trigger(w.ERROR,{type:J.MEDIA_ERROR,details:F.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:i.url,error:C,reason:C.message})}})},t.onError=function(e,i){!i.fatal&&i.context&&i.context.type===xe&&i.context.level===this.level&&this.checkRetry(i)},t.onFragLoaded=function(e,i){var a=i.frag;if(a!==void 0&&a.type===ft){var o=this._levels[a.level];o!==void 0&&(o.loadError=0)}},t.onLevelLoaded=function(e,i){var a,o,l=i.level,d=i.details,h=this._levels[l];if(!h)return this.warn("Invalid level index "+l),void((o=i.deliveryDirectives)!=null&&o.skip&&(d.deltaUpdateFailed=!0));l===this.currentLevelIndex?(h.fragmentError===0&&(h.loadError=0),this.playlistLoaded(l,i,h.details)):(a=i.deliveryDirectives)!=null&&a.skip&&(d.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(e,i){var a=this.currentLevel;if(a){var o=this.hls.audioTracks[i.id].groupId;if(a.audioGroupIds&&a.audioGroupId!==o){for(var l=-1,d=0;d<a.audioGroupIds.length;d++)if(a.audioGroupIds[d]===o){l=d;break}l!==-1&&l!==a.urlId&&(a.urlId=l,this.canLoad&&this.startLoad())}}},t.loadPlaylist=function(e){s.prototype.loadPlaylist.call(this);var i=this.currentLevelIndex,a=this.currentLevel;if(a&&this.shouldLoadPlaylist(a)){var o=a.urlId,l=a.uri;if(e)try{l=e.addDirectives(l)}catch(h){this.warn("Could not construct new URL with HLS Delivery Directives: "+h)}var d=a.attrs["PATHWAY-ID"];this.log("Loading level index "+i+(e?.msn!==void 0?" at sn "+e.msn+" part "+e.part:"")+" with"+(d?" Pathway "+d:"")+" URI "+(o+1)+"/"+a.url.length+" "+l),this.clearTimer(),this.hls.trigger(w.LEVEL_LOADING,{url:l,level:i,id:o,deliveryDirectives:e||null})}},t.removeLevel=function(e,i){var a=this,o=function(d,h){return h!==i},l=this._levels.filter(function(d,h){return h!==e||(d.url.length>1&&i!==void 0?(d.url=d.url.filter(o),d.audioGroupIds&&(d.audioGroupIds=d.audioGroupIds.filter(o)),d.textGroupIds&&(d.textGroupIds=d.textGroupIds.filter(o)),d.urlId=0,!0):(a.steering&&a.steering.removeLevel(d),!1))});this.hls.trigger(w.LEVELS_UPDATED,{levels:l})},t.onLevelsUpdated=function(e,i){var a=i.levels;a.forEach(function(o,l){var d=o.details;d!=null&&d.fragments&&d.fragments.forEach(function(h){h.level=l})}),this._levels=a},X(n,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var i=this._levels;if(i.length!==0){if(e<0||e>=i.length){var a=new Error("invalid level idx"),o=e<0;if(this.hls.trigger(w.ERROR,{type:J.OTHER_ERROR,details:F.LEVEL_SWITCH_ERROR,level:e,fatal:o,error:a,reason:a.message}),o)return;e=Math.min(e,i.length-1)}var l=this.currentLevelIndex,d=this.currentLevel,h=d?d.attrs["PATHWAY-ID"]:void 0,u=i[e],f=u.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=u,l!==e||!u.details||!d||h!==f){this.log("Switching to level "+e+(f?" with Pathway "+f:"")+" from level "+l+(h?" with Pathway "+h:""));var p=pt({},u,{level:e,maxBitrate:u.maxBitrate,attrs:u.attrs,uri:u.uri,urlId:u.urlId});delete p._attrs,delete p._urlId,this.hls.trigger(w.LEVEL_SWITCHING,p);var m=u.details;if(!m||m.live){var v=this.switchParams(u.uri,d?.details);this.loadPlaylist(v)}}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var e=this.hls.config.startLevel;return e!==void 0?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}}]),n})(qi);function Vr(s,n,t){t&&(n==="audio"?(s.audioGroupIds||(s.audioGroupIds=[]),s.audioGroupIds[s.url.length-1]=t):n==="text"&&(s.textGroupIds||(s.textGroupIds=[]),s.textGroupIds[s.url.length-1]=t))}function Yn(s){var n={};s.forEach(function(t){var e=t.groupId||"";t.id=n[e]=n[e]||0,n[e]++})}var dr="NOT_LOADED",Gn="APPENDING",Ye="PARTIAL",hr="OK",nc=(function(){function s(t){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=t,this._registerListeners()}var n=s.prototype;return n._registerListeners=function(){var t=this.hls;t.on(w.BUFFER_APPENDED,this.onBufferAppended,this),t.on(w.FRAG_BUFFERED,this.onFragBuffered,this),t.on(w.FRAG_LOADED,this.onFragLoaded,this)},n._unregisterListeners=function(){var t=this.hls;t.off(w.BUFFER_APPENDED,this.onBufferAppended,this),t.off(w.FRAG_BUFFERED,this.onFragBuffered,this),t.off(w.FRAG_LOADED,this.onFragLoaded,this)},n.destroy=function(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null},n.getAppendedFrag=function(t,e){var i=this.activePartLists[e];if(i)for(var a=i.length;a--;){var o=i[a];if(!o)break;var l=o.end;if(o.start<=t&&l!==null&&t<=l)return o}return this.getBufferedFrag(t,e)},n.getBufferedFrag=function(t,e){for(var i=this.fragments,a=Object.keys(i),o=a.length;o--;){var l=i[a[o]];if(l?.body.type===e&&l.buffered){var d=l.body;if(d.start<=t&&t<=d.end)return d}}return null},n.detectEvictedFragments=function(t,e,i,a){var o=this;this.timeRanges&&(this.timeRanges[t]=e);var l=a?.fragment.sn||-1;Object.keys(this.fragments).forEach(function(d){var h=o.fragments[d];if(h&&!(l>=h.body.sn))if(h.buffered||h.loaded){var u=h.range[t];u&&u.time.some(function(f){var p=!o.isTimeBuffered(f.startPTS,f.endPTS,e);return p&&o.removeFragment(h.body),p})}else h.body.type===i&&o.removeFragment(h.body)})},n.detectPartialFragments=function(t){var e=this,i=this.timeRanges,a=t.frag,o=t.part;if(i&&a.sn!=="initSegment"){var l=Ge(a),d=this.fragments[l];if(!(!d||d.buffered&&a.gap)){var h=!a.relurl;Object.keys(i).forEach(function(u){var f=a.elementaryStreams[u];if(f){var p=i[u],m=h||f.partial===!0;d.range[u]=e.getBufferedTimes(a,o,m,p)}}),d.loaded=null,Object.keys(d.range).length?(d.buffered=!0,(d.body.endList=a.endList||d.body.endList)&&(this.endListFragments[d.body.type]=d),qr(d)||this.removeParts(a.sn-1,a.type)):this.removeFragment(d.body)}}},n.removeParts=function(t,e){var i=this.activePartLists[e];i&&(this.activePartLists[e]=i.filter(function(a){return a.fragment.sn>=t}))},n.fragBuffered=function(t,e){var i=Ge(t),a=this.fragments[i];!a&&e&&(a=this.fragments[i]={body:t,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},t.gap&&(this.hasGaps=!0)),a&&(a.loaded=null,a.buffered=!0)},n.getBufferedTimes=function(t,e,i,a){for(var o={time:[],partial:i},l=t.start,d=t.end,h=t.minEndPTS||d,u=t.maxStartPTS||l,f=0;f<a.length;f++){var p=a.start(f)-this.bufferPadding,m=a.end(f)+this.bufferPadding;if(u>=p&&h<=m){o.time.push({startPTS:Math.max(l,a.start(f)),endPTS:Math.min(d,a.end(f))});break}if(l<m&&d>p)o.partial=!0,o.time.push({startPTS:Math.max(l,a.start(f)),endPTS:Math.min(d,a.end(f))});else if(d<=p)break}return o},n.getPartialFragment=function(t){var e,i,a,o=null,l=0,d=this.bufferPadding,h=this.fragments;return Object.keys(h).forEach(function(u){var f=h[u];f&&qr(f)&&(i=f.body.start-d,a=f.body.end+d,t>=i&&t<=a&&(e=Math.min(t-i,a-t),l<=e&&(o=f.body,l=e)))}),o},n.isEndListAppended=function(t){var e=this.endListFragments[t];return e!==void 0&&(e.buffered||qr(e))},n.getState=function(t){var e=Ge(t),i=this.fragments[e];return i?i.buffered?qr(i)?Ye:hr:Gn:dr},n.isTimeBuffered=function(t,e,i){for(var a,o,l=0;l<i.length;l++){if(a=i.start(l)-this.bufferPadding,o=i.end(l)+this.bufferPadding,t>=a&&e<=o)return!0;if(e<=a)return!1}return!1},n.onFragLoaded=function(t,e){var i=e.frag,a=e.part;if(i.sn!=="initSegment"&&!i.bitrateTest){var o=a?null:e,l=Ge(i);this.fragments[l]={body:i,appendedPTS:null,loaded:o,buffered:!1,range:Object.create(null)}}},n.onBufferAppended=function(t,e){var i=this,a=e.frag,o=e.part,l=e.timeRanges;if(a.sn!=="initSegment"){var d=a.type;if(o){var h=this.activePartLists[d];h||(this.activePartLists[d]=h=[]),h.push(o)}this.timeRanges=l,Object.keys(l).forEach(function(u){var f=l[u];i.detectEvictedFragments(u,f,d,o)})}},n.onFragBuffered=function(t,e){this.detectPartialFragments(e)},n.hasFragment=function(t){var e=Ge(t);return!!this.fragments[e]},n.hasParts=function(t){var e;return!((e=this.activePartLists[t])==null||!e.length)},n.removeFragmentsInRange=function(t,e,i,a,o){var l=this;a&&!this.hasGaps||Object.keys(this.fragments).forEach(function(d){var h=l.fragments[d];if(h){var u=h.body;u.type!==i||a&&!u.gap||u.start<e&&u.end>t&&(h.buffered||o)&&l.removeFragment(u)}})},n.removeFragment=function(t){var e=Ge(t);t.stats.loaded=0,t.clearElementaryStreamInfo();var i=this.activePartLists[t.type];if(i){var a=t.sn;this.activePartLists[t.type]=i.filter(function(o){return o.fragment.sn!==a})}delete this.fragments[e],t.endList&&delete this.endListFragments[t.type]},n.removeAllFragments=function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1},s})();function qr(s){var n,t,e;return s.buffered&&(s.body.gap||((n=s.range.video)==null?void 0:n.partial)||((t=s.range.audio)==null?void 0:t.partial)||((e=s.range.audiovideo)==null?void 0:e.partial))}function Ge(s){return s.type+"_"+s.level+"_"+s.urlId+"_"+s.sn}var zn=Math.pow(2,17),oc=(function(){function s(t){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}var n=s.prototype;return n.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},n.abort=function(){this.loader&&this.loader.abort()},n.load=function(t,e){var i=this,a=t.url;if(!a)return Promise.reject(new pe({type:J.NETWORK_ERROR,details:F.FRAG_LOAD_ERROR,fatal:!1,frag:t,error:new Error("Fragment does not have a "+(a?"part list":"url")),networkDetails:null}));this.abort();var o=this.config,l=o.fLoader,d=o.loader;return new Promise(function(h,u){if(i.loader&&i.loader.destroy(),t.gap){if(t.tagList.some(function(y){return y[0]==="GAP"}))return void u(qn(t));t.gap=!1}var f=i.loader=t.loader=l?new l(o):new d(o),p=Vn(t),m=Nn(o.fragLoadPolicy.default),v={loadPolicy:m,timeout:m.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:t.sn==="initSegment"?1/0:zn};t.stats=f.stats,f.load(p,v,{onSuccess:function(y,E,b,C){i.resetLoader(t,f);var L=y.data;b.resetIV&&t.decryptdata&&(t.decryptdata.iv=new Uint8Array(L.slice(0,16)),L=L.slice(16)),h({frag:t,part:null,payload:L,networkDetails:C})},onError:function(y,E,b,C){i.resetLoader(t,f),u(new pe({type:J.NETWORK_ERROR,details:F.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:O({url:a,data:void 0},y),error:new Error("HTTP Error "+y.code+" "+y.text),networkDetails:b,stats:C}))},onAbort:function(y,E,b){i.resetLoader(t,f),u(new pe({type:J.NETWORK_ERROR,details:F.INTERNAL_ABORTED,fatal:!1,frag:t,error:new Error("Aborted"),networkDetails:b,stats:y}))},onTimeout:function(y,E,b){i.resetLoader(t,f),u(new pe({type:J.NETWORK_ERROR,details:F.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,error:new Error("Timeout after "+v.timeout+"ms"),networkDetails:b,stats:y}))},onProgress:function(y,E,b,C){e&&e({frag:t,part:null,payload:b,networkDetails:C})}})})},n.loadPart=function(t,e,i){var a=this;this.abort();var o=this.config,l=o.fLoader,d=o.loader;return new Promise(function(h,u){if(a.loader&&a.loader.destroy(),t.gap||e.gap)u(qn(t,e));else{var f=a.loader=t.loader=l?new l(o):new d(o),p=Vn(t,e),m=Nn(o.fragLoadPolicy.default),v={loadPolicy:m,timeout:m.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:zn};e.stats=f.stats,f.load(p,v,{onSuccess:function(y,E,b,C){a.resetLoader(t,f),a.updateStatsFromPart(t,e);var L={frag:t,part:e,payload:y.data,networkDetails:C};i(L),h(L)},onError:function(y,E,b,C){a.resetLoader(t,f),u(new pe({type:J.NETWORK_ERROR,details:F.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:e,response:O({url:p.url,data:void 0},y),error:new Error("HTTP Error "+y.code+" "+y.text),networkDetails:b,stats:C}))},onAbort:function(y,E,b){t.stats.aborted=e.stats.aborted,a.resetLoader(t,f),u(new pe({type:J.NETWORK_ERROR,details:F.INTERNAL_ABORTED,fatal:!1,frag:t,part:e,error:new Error("Aborted"),networkDetails:b,stats:y}))},onTimeout:function(y,E,b){a.resetLoader(t,f),u(new pe({type:J.NETWORK_ERROR,details:F.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:e,error:new Error("Timeout after "+v.timeout+"ms"),networkDetails:b,stats:y}))}})}})},n.updateStatsFromPart=function(t,e){var i=t.stats,a=e.stats,o=a.total;if(i.loaded+=a.loaded,o){var l=Math.round(t.duration/e.duration),d=Math.min(Math.round(i.loaded/o),l),h=(l-d)*Math.round(i.loaded/d);i.total=i.loaded+h}else i.total=Math.max(i.loaded,i.total);var u=i.loading,f=a.loading;u.start?u.first+=f.first-f.start:(u.start=f.start,u.first=f.first),u.end=f.end},n.resetLoader=function(t,e){t.loader=null,this.loader===e&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),e.destroy()},s})();function Vn(s,n){n===void 0&&(n=null);var t=n||s,e={frag:s,part:n,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},i=t.byteRangeStartOffset,a=t.byteRangeEndOffset;if(Z(i)&&Z(a)){var o,l=i,d=a;if(s.sn==="initSegment"&&((o=s.decryptdata)==null?void 0:o.method)==="AES-128"){var h=a-i;h%16&&(d=a+(16-h%16)),i!==0&&(e.resetIV=!0,l=i-16)}e.rangeStart=l,e.rangeEnd=d}return e}function qn(s,n){var t=new Error("GAP "+(s.gap?"tag":"attribute")+" found"),e={type:J.MEDIA_ERROR,details:F.FRAG_GAP,fatal:!1,frag:s,error:t,networkDetails:null};return n&&(e.part=n),(n||s).stats.aborted=!0,new pe(e)}var pe=(function(s){function n(t){var e;return(e=s.call(this,t.error.message)||this).data=void 0,e.data=t,e}return Et(n,s),n})(Tt(Error)),sc=(function(){function s(t){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=t}var n=s.prototype;return n.abort=function(t){for(var e in this.keyUriToKeyInfo){var i=this.keyUriToKeyInfo[e].loader;if(i){if(t&&t!==i.context.frag.type)return;i.abort()}}},n.detach=function(){for(var t in this.keyUriToKeyInfo){var e=this.keyUriToKeyInfo[t];(e.mediaKeySessionContext||e.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[t]}},n.destroy=function(){for(var t in this.detach(),this.keyUriToKeyInfo){var e=this.keyUriToKeyInfo[t].loader;e&&e.destroy()}this.keyUriToKeyInfo={}},n.createKeyLoadError=function(t,e,i,a,o){return e===void 0&&(e=F.KEY_LOAD_ERROR),new pe({type:J.NETWORK_ERROR,details:e,fatal:!1,frag:t,response:o,error:i,networkDetails:a})},n.loadClear=function(t,e){var i=this;if(this.emeController&&this.config.emeEnabled)for(var a=t.sn,o=t.cc,l=function(){var h=e[d];if(o<=h.cc&&(a==="initSegment"||h.sn==="initSegment"||a<h.sn))return i.emeController.selectKeySystemFormat(h).then(function(u){h.setKeyFormat(u)}),"break"},d=0;d<e.length&&l()!=="break";d++);},n.load=function(t){var e=this;return!t.decryptdata&&t.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(t).then(function(i){return e.loadInternal(t,i)}):this.loadInternal(t)},n.loadInternal=function(t,e){var i,a;e&&t.setKeyFormat(e);var o=t.decryptdata;if(!o){var l=new Error(e?"Expected frag.decryptdata to be defined after setting format "+e:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(t,F.KEY_LOAD_ERROR,l))}var d=o.uri;if(!d)return Promise.reject(this.createKeyLoadError(t,F.KEY_LOAD_ERROR,new Error('Invalid key URI: "'+d+'"')));var h,u=this.keyUriToKeyInfo[d];if((i=u)!=null&&i.decryptdata.key)return o.key=u.decryptdata.key,Promise.resolve({frag:t,keyInfo:u});if((a=u)!=null&&a.keyLoadPromise)switch((h=u.mediaKeySessionContext)==null?void 0:h.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return u.keyLoadPromise.then(function(f){return o.key=f.keyInfo.decryptdata.key,{frag:t,keyInfo:u}})}switch(u=this.keyUriToKeyInfo[d]={decryptdata:o,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},o.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return o.keyFormat==="identity"?this.loadKeyHTTP(u,t):this.loadKeyEME(u,t);case"AES-128":return this.loadKeyHTTP(u,t);default:return Promise.reject(this.createKeyLoadError(t,F.KEY_LOAD_ERROR,new Error('Key supplied with unsupported METHOD: "'+o.method+'"')))}},n.loadKeyEME=function(t,e){var i={frag:e,keyInfo:t};if(this.emeController&&this.config.emeEnabled){var a=this.emeController.loadKey(i);if(a)return(t.keyLoadPromise=a.then(function(o){return t.mediaKeySessionContext=o,i})).catch(function(o){throw t.keyLoadPromise=null,o})}return Promise.resolve(i)},n.loadKeyHTTP=function(t,e){var i=this,a=this.config,o=new a.loader(a);return e.keyLoader=t.loader=o,t.keyLoadPromise=new Promise(function(l,d){var h={keyInfo:t,frag:e,responseType:"arraybuffer",url:t.decryptdata.uri},u=a.keyLoadPolicy.default,f={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0};o.load(h,f,{onSuccess:function(p,m,v,y){var E=v.frag,b=v.keyInfo,C=v.url;if(!E.decryptdata||b!==i.keyUriToKeyInfo[C])return d(i.createKeyLoadError(E,F.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),y));b.decryptdata.key=E.decryptdata.key=new Uint8Array(p.data),E.keyLoader=null,b.loader=null,l({frag:E,keyInfo:b})},onError:function(p,m,v,y){i.resetLoader(m),d(i.createKeyLoadError(e,F.KEY_LOAD_ERROR,new Error("HTTP Error "+p.code+" loading key "+p.text),v,O({url:h.url,data:void 0},p)))},onTimeout:function(p,m,v){i.resetLoader(m),d(i.createKeyLoadError(e,F.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),v))},onAbort:function(p,m,v){i.resetLoader(m),d(i.createKeyLoadError(e,F.INTERNAL_ABORTED,new Error("key loading aborted"),v))}})})},n.resetLoader=function(t){var e=t.frag,i=t.keyInfo,a=t.url,o=i.loader;e.keyLoader===o&&(e.keyLoader=null,i.loader=null),delete this.keyUriToKeyInfo[a],o&&o.destroy()},s})(),lc=(function(){function s(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var n=s.prototype;return n.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},n.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},n.onHandlerDestroyed=function(){},n.hasInterval=function(){return!!this._tickInterval},n.hasNextTick=function(){return!!this._tickTimer},n.setInterval=function(t){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,t),!0)},n.clearInterval=function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)},n.clearNextTick=function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)},n.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},n.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},n.doTick=function(){},s})(),cc={length:0,start:function(){return 0},end:function(){return 0}},It=(function(){function s(){}return s.isBuffered=function(n,t){try{if(n){for(var e=s.getBuffered(n),i=0;i<e.length;i++)if(t>=e.start(i)&&t<=e.end(i))return!0}}catch{}return!1},s.bufferInfo=function(n,t,e){try{if(n){var i,a=s.getBuffered(n),o=[];for(i=0;i<a.length;i++)o.push({start:a.start(i),end:a.end(i)});return this.bufferedInfo(o,t,e)}}catch{}return{len:0,start:t,end:t,nextStart:void 0}},s.bufferedInfo=function(n,t,e){t=Math.max(0,t),n.sort(function(y,E){return y.start-E.start||E.end-y.end});var i=[];if(e)for(var a=0;a<n.length;a++){var o=i.length;if(o){var l=i[o-1].end;n[a].start-l<e?n[a].end>l&&(i[o-1].end=n[a].end):i.push(n[a])}else i.push(n[a])}else i=n;for(var d,h=0,u=t,f=t,p=0;p<i.length;p++){var m=i[p].start,v=i[p].end;if(t+e>=m&&t<v)u=m,h=(f=v)-t;else if(t+e<m){d=m;break}}return{len:h,start:u||0,end:f||0,nextStart:d}},s.getBuffered=function(n){try{return n.buffered}catch(t){return T.log("failed to get media.buffered",t),cc}},s})(),_i=function(s,n,t,e,i,a){e===void 0&&(e=0),i===void 0&&(i=-1),a===void 0&&(a=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=s,this.sn=n,this.id=t,this.size=e,this.part=i,this.partial=a};function _n(s,n){for(var t=null,e=0,i=s.length;e<i;e++){var a=s[e];if(a&&a.cc===n){t=a;break}}return t}function Wn(s,n){if(s){var t=s.start+n;s.start=s.startPTS=t,s.endPTS=t+s.duration}}function Wi(s,n){for(var t=n.fragments,e=0,i=t.length;e<i;e++)Wn(t[e],s);n.fragmentHint&&Wn(n.fragmentHint,s),n.alignedSliding=!0}function dc(s,n,t){n&&((function(e,i,a){if((function(l,d,h){return!(!d.details||!(h.endCC>h.startCC||l&&l.cc<h.startCC))})(e,a,i)){var o=(function(l,d,h){var u=l.fragments,f=d.fragments;if(f.length&&u.length){var p=_n(u,f[0].cc);if(p&&(!p||p.startPTS))return p;T.log("No frag in previous level to align on")}else T.log("No fragments to align")})(a.details,i);o&&Z(o.start)&&(T.log("Adjusting PTS using last level due to CC increase within current level "+i.url),Wi(o.start,i))}})(s,t,n),!t.alignedSliding&&n.details&&(function(e,i){if(i.fragments.length&&e.hasProgramDateTime&&i.hasProgramDateTime){var a=i.fragments[0].programDateTime,o=e.fragments[0].programDateTime,l=(o-a)/1e3+i.fragments[0].start;l&&Z(l)&&(T.log("Adjusting PTS using programDateTime delta "+(o-a)+"ms, sliding:"+l.toFixed(3)+" "+e.url+" "),Wi(l,e))}})(t,n.details),t.alignedSliding||!n.details||t.skippedSegments||On(n.details,t))}function Xn(s,n){if(s.hasProgramDateTime&&n.hasProgramDateTime){var t=s.fragments,e=n.fragments;if(t.length&&e.length){var i=e[Math.round(e.length/2)-1],a=_n(t,i.cc)||t[Math.round(t.length/2)-1],o=i.programDateTime,l=a.programDateTime;o!==null&&l!==null&&Wi((l-o)/1e3-(a.start-i.start),s)}}}var hc=(function(){function s(n,t){this.subtle=void 0,this.aesIV=void 0,this.subtle=n,this.aesIV=t}return s.prototype.decrypt=function(n,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,n)},s})(),uc=(function(){function s(n,t){this.subtle=void 0,this.key=void 0,this.subtle=n,this.key=t}return s.prototype.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},s})(),gc=(function(){function s(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var n=s.prototype;return n.uint8ArrayToUint32Array_=function(t){for(var e=new DataView(t),i=new Uint32Array(4),a=0;a<4;a++)i[a]=e.getUint32(4*a);return i},n.initTable=function(){var t=this.sBox,e=this.invSBox,i=this.subMix,a=i[0],o=i[1],l=i[2],d=i[3],h=this.invSubMix,u=h[0],f=h[1],p=h[2],m=h[3],v=new Uint32Array(256),y=0,E=0,b=0;for(b=0;b<256;b++)v[b]=b<128?b<<1:b<<1^283;for(b=0;b<256;b++){var C=E^E<<1^E<<2^E<<3^E<<4;C=C>>>8^255&C^99,t[y]=C,e[C]=y;var L=v[y],I=v[L],S=v[I],R=257*v[C]^16843008*C;a[y]=R<<24|R>>>8,o[y]=R<<16|R>>>16,l[y]=R<<8|R>>>24,d[y]=R,R=16843009*S^65537*I^257*L^16843008*y,u[C]=R<<24|R>>>8,f[C]=R<<16|R>>>16,p[C]=R<<8|R>>>24,m[C]=R,y?(y=L^v[v[v[S^L]]],E^=v[v[E]]):y=E=1}},n.expandKey=function(t){for(var e=this.uint8ArrayToUint32Array_(t),i=!0,a=0;a<e.length&&i;)i=e[a]===this.key[a],a++;if(!i){this.key=e;var o=this.keySize=e.length;if(o!==4&&o!==6&&o!==8)throw new Error("Invalid aes key size="+o);var l,d,h,u,f=this.ksRows=4*(o+6+1),p=this.keySchedule=new Uint32Array(f),m=this.invKeySchedule=new Uint32Array(f),v=this.sBox,y=this.rcon,E=this.invSubMix,b=E[0],C=E[1],L=E[2],I=E[3];for(l=0;l<f;l++)l<o?h=p[l]=e[l]:(u=h,l%o==0?(u=v[(u=u<<8|u>>>24)>>>24]<<24|v[u>>>16&255]<<16|v[u>>>8&255]<<8|v[255&u],u^=y[l/o|0]<<24):o>6&&l%o==4&&(u=v[u>>>24]<<24|v[u>>>16&255]<<16|v[u>>>8&255]<<8|v[255&u]),p[l]=h=(p[l-o]^u)>>>0);for(d=0;d<f;d++)l=f-d,u=3&d?p[l]:p[l-4],m[d]=d<4||l<=4?u:b[v[u>>>24]]^C[v[u>>>16&255]]^L[v[u>>>8&255]]^I[v[255&u]],m[d]=m[d]>>>0}},n.networkToHostOrderSwap=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24},n.decrypt=function(t,e,i){for(var a,o,l,d,h,u,f,p,m,v,y,E,b,C,L=this.keySize+6,I=this.invKeySchedule,S=this.invSBox,R=this.invSubMix,M=R[0],Q=R[1],P=R[2],U=R[3],K=this.uint8ArrayToUint32Array_(i),H=K[0],V=K[1],j=K[2],q=K[3],W=new Int32Array(t),tt=new Int32Array(W.length),G=this.networkToHostOrderSwap;e<W.length;){for(m=G(W[e]),v=G(W[e+1]),y=G(W[e+2]),E=G(W[e+3]),h=m^I[0],u=E^I[1],f=y^I[2],p=v^I[3],b=4,C=1;C<L;C++)a=M[h>>>24]^Q[u>>16&255]^P[f>>8&255]^U[255&p]^I[b],o=M[u>>>24]^Q[f>>16&255]^P[p>>8&255]^U[255&h]^I[b+1],l=M[f>>>24]^Q[p>>16&255]^P[h>>8&255]^U[255&u]^I[b+2],d=M[p>>>24]^Q[h>>16&255]^P[u>>8&255]^U[255&f]^I[b+3],h=a,u=o,f=l,p=d,b+=4;a=S[h>>>24]<<24^S[u>>16&255]<<16^S[f>>8&255]<<8^S[255&p]^I[b],o=S[u>>>24]<<24^S[f>>16&255]<<16^S[p>>8&255]<<8^S[255&h]^I[b+1],l=S[f>>>24]<<24^S[p>>16&255]<<16^S[h>>8&255]<<8^S[255&u]^I[b+2],d=S[p>>>24]<<24^S[h>>16&255]<<16^S[u>>8&255]<<8^S[255&f]^I[b+3],tt[e]=G(a^H),tt[e+1]=G(d^V),tt[e+2]=G(l^j),tt[e+3]=G(o^q),H=m,V=v,j=y,q=E,e+=4}return tt.buffer},s})(),Xi=(function(){function s(t,e){var i=(e===void 0?{}:e).removePKCS7Padding,a=i===void 0||i;if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=t.enableSoftwareAES,this.removePKCS7Padding=a,a)try{var o=self.crypto;o&&(this.subtle=o.subtle||o.webkitSubtle)}catch{}this.subtle===null&&(this.useSoftware=!0)}var n=s.prototype;return n.destroy=function(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null},n.isSync=function(){return this.useSoftware},n.flush=function(){var t=this.currentResult,e=this.remainderData;if(!t||e)return this.reset(),null;var i,a,o,l=new Uint8Array(t);return this.reset(),this.removePKCS7Padding?(a=(i=l).byteLength,(o=a&&new DataView(i.buffer).getUint8(a-1))?Le(i,0,a-o):i):l},n.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},n.decrypt=function(t,e,i){var a=this;return this.useSoftware?new Promise(function(o,l){a.softwareDecrypt(new Uint8Array(t),e,i);var d=a.flush();d?o(d.buffer):l(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(t),e,i)},n.softwareDecrypt=function(t,e,i){var a=this.currentIV,o=this.currentResult,l=this.remainderData;this.logOnce("JS AES decrypt"),l&&(t=Se(l,t),this.remainderData=null);var d=this.getValidChunk(t);if(!d.length)return null;a&&(i=a);var h=this.softwareDecrypter;h||(h=this.softwareDecrypter=new gc),h.expandKey(e);var u=o;return this.currentResult=h.decrypt(d.buffer,0,i),this.currentIV=Le(d,-16).buffer,u||null},n.webCryptoDecrypt=function(t,e,i){var a=this,o=this.subtle;return this.key===e&&this.fastAesKey||(this.key=e,this.fastAesKey=new uc(o,e)),this.fastAesKey.expandKey().then(function(l){return o?(a.logOnce("WebCrypto AES decrypt"),new hc(o,new Uint8Array(i)).decrypt(t.buffer,l)):Promise.reject(new Error("web crypto not initialized"))}).catch(function(l){return T.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, "+l.name+": "+l.message),a.onWebCryptoError(t,e,i)})},n.onWebCryptoError=function(t,e,i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(t,e,i);var a=this.flush();if(a)return a.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")},n.getValidChunk=function(t){var e=t,i=t.length-t.length%16;return i!==t.length&&(e=Le(t,0,i),this.remainderData=Le(t,i)),e},n.logOnce=function(t){this.logEnabled&&(T.log("[decrypter]: "+t),this.logEnabled=!1)},s})(),fc=function(s){for(var n="",t=s.length,e=0;e<t;e++)n+="["+s.start(e).toFixed(3)+"-"+s.end(e).toFixed(3)+"]";return n},Wt="STOPPED",ot="IDLE",Zi="KEY_LOADING",ze="FRAG_LOADING",Ve="FRAG_LOADING_WAITING_RETRY",ur="WAITING_TRACK",Ae="PARSING",_r="PARSED",gr="ENDED",qe="ERROR",fr="WAITING_INIT_PTS",Te="WAITING_LEVEL",Ji=(function(s){function n(e,i,a,o,l){var d;return(d=s.call(this)||this).hls=void 0,d.fragPrevious=null,d.fragCurrent=null,d.fragmentTracker=void 0,d.transmuxer=null,d._state=Wt,d.playlistType=void 0,d.media=null,d.mediaBuffer=null,d.config=void 0,d.bitrateTest=!1,d.lastCurrentTime=0,d.nextLoadPosition=0,d.startPosition=0,d.startTimeOffset=null,d.loadedmetadata=!1,d.retryDate=0,d.levels=null,d.fragmentLoader=void 0,d.keyLoader=void 0,d.levelLastLoaded=null,d.startFragRequested=!1,d.decrypter=void 0,d.initPTS=[],d.onvseeking=null,d.onvended=null,d.logPrefix="",d.log=void 0,d.warn=void 0,d.playlistType=l,d.logPrefix=o,d.log=T.log.bind(T,o+":"),d.warn=T.warn.bind(T,o+":"),d.hls=e,d.fragmentLoader=new oc(e.config),d.keyLoader=a,d.fragmentTracker=i,d.config=e.config,d.decrypter=new Xi(e.config),e.on(w.MANIFEST_LOADED,d.onManifestLoaded,(function(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h})(d)),d}Et(n,s);var t=n.prototype;return t.doTick=function(){this.onTickEnd()},t.onTickEnd=function(){},t.startLoad=function(e){},t.stopLoad=function(){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);var e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Wt},t._streamEnded=function(e,i){if(i.live||e.nextStart||!e.end||!this.media)return!1;var a=i.partList;if(a!=null&&a.length){var o=a[a.length-1];return It.isBuffered(this.media,o.start+o.duration/2)}var l=i.fragments[i.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(l)},t.getLevelDetails=function(){var e;if(this.levels&&this.levelLastLoaded!==null)return(e=this.levels[this.levelLastLoaded])==null?void 0:e.details},t.onMediaAttached=function(e,i){var a=this.media=this.mediaBuffer=i.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),a.addEventListener("seeking",this.onvseeking),a.addEventListener("ended",this.onvended);var o=this.config;this.levels&&o.autoStartLoad&&this.state===Wt&&this.startLoad(o.startPosition)},t.onMediaDetaching=function(){var e=this.media;e!=null&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},t.onMediaSeeking=function(){var e=this.config,i=this.fragCurrent,a=this.media,o=this.mediaBuffer,l=this.state,d=a?a.currentTime:0,h=It.bufferInfo(o||a,d,e.maxBufferHole);if(this.log("media seeking to "+(Z(d)?d.toFixed(3):d)+", state: "+l),this.state===gr)this.resetLoadingState();else if(i){var u=e.maxFragLookUpTolerance,f=i.start-u,p=i.start+i.duration+u;if(!h.len||p<h.start||f>h.end){var m=d>p;(d<f||m)&&(m&&i.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),i.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}a&&(this.fragmentTracker.removeFragmentsInRange(d,1/0,this.playlistType,!0),this.lastCurrentTime=d),this.loadedmetadata||h.len||(this.nextLoadPosition=this.startPosition=d),this.tickImmediate()},t.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},t.onManifestLoaded=function(e,i){this.startTimeOffset=i.startTimeOffset,this.initPTS=[]},t.onHandlerDestroying=function(){this.stopLoad(),s.prototype.onHandlerDestroying.call(this)},t.onHandlerDestroyed=function(){this.state=Wt,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,s.prototype.onHandlerDestroyed.call(this)},t.loadFragment=function(e,i,a){this._loadFragForPlayback(e,i,a)},t._loadFragForPlayback=function(e,i,a){var o=this;this._doFragLoad(e,i,a,function(l){if(o.fragContextChanged(e))return o.warn("Fragment "+e.sn+(l.part?" p: "+l.part.index:"")+" of level "+e.level+" was dropped during download."),void o.fragmentTracker.removeFragment(e);e.stats.chunkCount++,o._handleFragmentLoadProgress(l)}).then(function(l){if(l){var d=o.state;o.fragContextChanged(e)?(d===ze||!o.fragCurrent&&d===Ae)&&(o.fragmentTracker.removeFragment(e),o.state=ot):("payload"in l&&(o.log("Loaded fragment "+e.sn+" of level "+e.level),o.hls.trigger(w.FRAG_LOADED,l)),o._handleFragmentLoadComplete(l))}}).catch(function(l){o.state!==Wt&&o.state!==qe&&(o.warn(l),o.resetFragmentLoading(e))})},t.clearTrackerIfNeeded=function(e){var i,a=this.fragmentTracker;if(a.getState(e)===Gn){var o=e.type,l=this.getFwdBufferInfo(this.mediaBuffer,o),d=Math.max(e.duration,l?l.len:this.config.maxBufferLength);this.reduceMaxBufferLength(d)&&a.removeFragment(e)}else((i=this.mediaBuffer)==null?void 0:i.buffered.length)===0?a.removeAllFragments():a.hasParts(e.type)&&(a.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),a.getState(e)===Ye&&a.removeFragment(e))},t.checkLiveUpdate=function(e){if(e.updated&&!e.live){var i=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:i,part:null,stats:i.stats,id:i.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)},t.flushMainBuffer=function(e,i,a){if(a===void 0&&(a=null),e-i){var o={startOffset:e,endOffset:i,type:a};this.hls.trigger(w.BUFFER_FLUSHING,o)}},t._loadInitSegment=function(e,i){var a=this;this._doFragLoad(e,i).then(function(o){if(!o||a.fragContextChanged(e)||!a.levels)throw new Error("init load aborted");return o}).then(function(o){var l=a.hls,d=o.payload,h=e.decryptdata;if(d&&d.byteLength>0&&h&&h.key&&h.iv&&h.method==="AES-128"){var u=self.performance.now();return a.decrypter.decrypt(new Uint8Array(d),h.key.buffer,h.iv.buffer).catch(function(f){throw l.trigger(w.ERROR,{type:J.MEDIA_ERROR,details:F.FRAG_DECRYPT_ERROR,fatal:!1,error:f,reason:f.message,frag:e}),f}).then(function(f){var p=self.performance.now();return l.trigger(w.FRAG_DECRYPTED,{frag:e,payload:f,stats:{tstart:u,tdecrypt:p}}),o.payload=f,o})}return o}).then(function(o){var l=a.fragCurrent,d=a.hls;if(!a.levels)throw new Error("init load aborted, missing levels");var h=e.stats;a.state=ot,i.fragmentError=0,e.data=new Uint8Array(o.payload),h.parsing.start=h.buffering.start=self.performance.now(),h.parsing.end=h.buffering.end=self.performance.now(),o.frag===l&&d.trigger(w.FRAG_BUFFERED,{stats:h,frag:l,part:null,id:e.type}),a.tick()}).catch(function(o){a.state!==Wt&&a.state!==qe&&(a.warn(o),a.resetFragmentLoading(e))})},t.fragContextChanged=function(e){var i=this.fragCurrent;return!e||!i||e.level!==i.level||e.sn!==i.sn||e.urlId!==i.urlId},t.fragBufferedComplete=function(e,i){var a,o,l,d,h=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+e.type+" sn: "+e.sn+(i?" part: "+i.index:"")+" of "+(this.playlistType===ft?"level":"track")+" "+e.level+" (frag:["+((a=e.startPTS)!=null?a:NaN).toFixed(3)+"-"+((o=e.endPTS)!=null?o:NaN).toFixed(3)+"] > buffer:"+(h?fc(It.getBuffered(h)):"(detached)")+")"),this.state=ot,h&&(!this.loadedmetadata&&e.type==ft&&h.buffered.length&&((l=this.fragCurrent)==null?void 0:l.sn)===((d=this.fragPrevious)==null?void 0:d.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},t.seekToStartPos=function(){},t._handleFragmentLoadComplete=function(e){var i=this.transmuxer;if(i){var a=e.frag,o=e.part,l=e.partsLoaded,d=!l||l.length===0||l.some(function(u){return!u}),h=new _i(a.level,a.sn,a.stats.chunkCount+1,0,o?o.index:-1,!d);i.flush(h)}},t._handleFragmentLoadProgress=function(e){},t._doFragLoad=function(e,i,a,o){var l,d=this;a===void 0&&(a=null);var h=i?.details;if(!this.levels||!h)throw new Error("frag load aborted, missing level"+(h?"":" detail")+"s");var u=null;if(!e.encrypted||(l=e.decryptdata)!=null&&l.key?!e.encrypted&&h.encryptedFragments.length&&this.keyLoader.loadClear(e,h.encryptedFragments):(this.log("Loading key for "+e.sn+" of ["+h.startSN+"-"+h.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+e.level),this.state=Zi,this.fragCurrent=e,u=this.keyLoader.load(e).then(function(b){if(!d.fragContextChanged(b.frag))return d.hls.trigger(w.KEY_LOADED,b),d.state===Zi&&(d.state=ot),b}),this.hls.trigger(w.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(u=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),a=Math.max(e.start,a||0),this.config.lowLatencyMode&&e.sn!=="initSegment"){var f=h.partList;if(f&&o){a>e.end&&h.fragmentHint&&(e=h.fragmentHint);var p=this.getNextPart(f,e,a);if(p>-1){var m,v=f[p];return this.log("Loading part sn: "+e.sn+" p: "+v.index+" cc: "+e.cc+" of playlist ["+h.startSN+"-"+h.endSN+"] parts [0-"+p+"-"+(f.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+e.level+", target: "+parseFloat(a.toFixed(3))),this.nextLoadPosition=v.start+v.duration,this.state=ze,m=u?u.then(function(b){return!b||d.fragContextChanged(b.frag)?null:d.doFragPartsLoad(e,v,i,o)}).catch(function(b){return d.handleFragLoadError(b)}):this.doFragPartsLoad(e,v,i,o).catch(function(b){return d.handleFragLoadError(b)}),this.hls.trigger(w.FRAG_LOADING,{frag:e,part:v,targetBufferTime:a}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):m}if(!e.url||this.loadedEndOfParts(f,a))return Promise.resolve(null)}}this.log("Loading fragment "+e.sn+" cc: "+e.cc+" "+(h?"of ["+h.startSN+"-"+h.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+e.level+", target: "+parseFloat(a.toFixed(3))),Z(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=ze;var y,E=this.config.progressive;return y=E&&u?u.then(function(b){return!b||d.fragContextChanged(b?.frag)?null:d.fragmentLoader.load(e,o)}).catch(function(b){return d.handleFragLoadError(b)}):Promise.all([this.fragmentLoader.load(e,E?o:void 0),u]).then(function(b){var C=b[0];return!E&&C&&o&&o(C),C}).catch(function(b){return d.handleFragLoadError(b)}),this.hls.trigger(w.FRAG_LOADING,{frag:e,targetBufferTime:a}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):y},t.doFragPartsLoad=function(e,i,a,o){var l=this;return new Promise(function(d,h){var u,f=[],p=(u=a.details)==null?void 0:u.partList;(function m(v){l.fragmentLoader.loadPart(e,v,o).then(function(y){f[v.index]=y;var E=y.part;l.hls.trigger(w.FRAG_LOADED,y);var b=Pn(a,e.sn,v.index+1)||Un(p,e.sn,v.index+1);if(!b)return d({frag:e,part:E,partsLoaded:f});m(b)}).catch(h)})(i)})},t.handleFragLoadError=function(e){if("data"in e){var i=e.data;e.data&&i.details===F.INTERNAL_ABORTED?this.handleFragLoadAborted(i.frag,i.part):this.hls.trigger(w.ERROR,i)}else this.hls.trigger(w.ERROR,{type:J.OTHER_ERROR,details:F.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null},t._handleTransmuxerFlush=function(e){var i=this.getCurrentContext(e);if(i&&this.state===Ae){var a=i.frag,o=i.part,l=i.level,d=self.performance.now();a.stats.parsing.end=d,o&&(o.stats.parsing.end=d),this.updateLevelTiming(a,o,l,e.partial)}else this.fragCurrent||this.state===Wt||this.state===qe||(this.state=ot)},t.getCurrentContext=function(e){var i=this.levels,a=this.fragCurrent,o=e.level,l=e.sn,d=e.part;if(i==null||!i[o])return this.warn("Levels object was unset while buffering fragment "+l+" of level "+o+". The current chunk will not be buffered."),null;var h=i[o],u=d>-1?Pn(h,l,d):null,f=u?u.fragment:(function(p,m,v){if(p==null||!p.details)return null;var y=p.details,E=y.fragments[m-y.startSN];return E||((E=y.fragmentHint)&&E.sn===m?E:m<y.startSN&&v&&v.sn===m?v:null)})(h,l,a);return f?(a&&a!==f&&(f.stats=a.stats),{frag:f,part:u,level:h}):null},t.bufferFragmentData=function(e,i,a,o,l){var d;if(e&&this.state===Ae){var h=e.data1,u=e.data2,f=h;if(h&&u&&(f=Se(h,u)),(d=f)!=null&&d.length){var p={type:e.type,frag:i,part:a,chunkMeta:o,parent:i.type,data:f};if(this.hls.trigger(w.BUFFER_APPENDING,p),e.dropped&&e.independent&&!a){if(l)return;this.flushBufferGap(i)}}}},t.flushBufferGap=function(e){var i=this.media;if(i)if(It.isBuffered(i,i.currentTime)){var a=i.currentTime,o=It.bufferInfo(i,a,0),l=e.duration,d=Math.min(2*this.config.maxFragLookUpTolerance,.25*l),h=Math.max(Math.min(e.start-d,o.end-d),a+d);e.start-h>d&&this.flushMainBuffer(h,e.start)}else this.flushMainBuffer(0,e.start)},t.getFwdBufferInfo=function(e,i){var a=this.getLoadPosition();return Z(a)?this.getFwdBufferInfoAtPos(e,a,i):null},t.getFwdBufferInfoAtPos=function(e,i,a){var o=this.config.maxBufferHole,l=It.bufferInfo(e,i,o);if(l.len===0&&l.nextStart!==void 0){var d=this.fragmentTracker.getBufferedFrag(i,a);if(d&&l.nextStart<d.end)return It.bufferInfo(e,i,Math.max(l.nextStart,o))}return l},t.getMaxBufferLength=function(e){var i,a=this.config;return i=e?Math.max(8*a.maxBufferSize/e,a.maxBufferLength):a.maxBufferLength,Math.min(i,a.maxMaxBufferLength)},t.reduceMaxBufferLength=function(e){var i=this.config,a=e||i.maxBufferLength;return i.maxMaxBufferLength>=a&&(i.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+i.maxMaxBufferLength+"s"),!0)},t.getAppendedFrag=function(e,i){var a=this.fragmentTracker.getAppendedFrag(e,ft);return a&&"fragment"in a?a.fragment:a},t.getNextFragment=function(e,i){var a=i.fragments,o=a.length;if(!o)return null;var l,d=this.config,h=a[0].start;if(i.live){var u=d.initialLiveManifestSize;if(o<u)return this.warn("Not enough fragments to start playback (have: "+o+", need: "+u+")"),null;i.PTSKnown||this.startFragRequested||this.startPosition!==-1||(l=this.getInitialLiveFragment(i,a),this.startPosition=l?this.hls.liveSyncPosition||l.start:e)}else e<=h&&(l=a[0]);if(!l){var f=d.lowLatencyMode?i.partEnd:i.fragmentEnd;l=this.getFragmentAtPosition(e,f,i)}return this.mapToInitFragWhenRequired(l)},t.isLoopLoading=function(e,i){var a=this.fragmentTracker.getState(e);return(a===hr||a===Ye&&!!e.gap)&&this.nextLoadPosition>i},t.getNextFragmentLoopLoading=function(e,i,a,o,l){var d=e.gap,h=this.getNextFragment(this.nextLoadPosition,i);if(h===null)return h;if(e=h,d&&e&&!e.gap&&a.nextStart){var u=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,a.nextStart,o);if(u!==null&&a.len+u.len>=l)return this.log('buffer full after gaps in "'+o+'" playlist starting at sn: '+e.sn),null}return e},t.mapToInitFragWhenRequired=function(e){return e==null||!e.initSegment||e!=null&&e.initSegment.data||this.bitrateTest?e:e.initSegment},t.getNextPart=function(e,i,a){for(var o=-1,l=!1,d=!0,h=0,u=e.length;h<u;h++){var f=e[h];if(d=d&&!f.independent,o>-1&&a<f.start)break;var p=f.loaded;p?o=-1:(l||f.independent||d)&&f.fragment===i&&(o=h),l=p}return o},t.loadedEndOfParts=function(e,i){var a=e[e.length-1];return a&&i>a.start&&a.loaded},t.getInitialLiveFragment=function(e,i){var a=this.fragPrevious,o=null;if(a){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+a.programDateTime),o=(function(u,f,p){if(f===null||!Array.isArray(u)||!u.length||!Z(f)||f<(u[0].programDateTime||0)||f>=(u[u.length-1].endProgramDateTime||0))return null;p=p||0;for(var m=0;m<u.length;++m){var v=u[m];if(ec(f,p,v))return v}return null})(i,a.endProgramDateTime,this.config.maxFragLookUpTolerance)),!o){var l=a.sn+1;if(l>=e.startSN&&l<=e.endSN){var d=i[l-e.startSN];a.cc===d.cc&&(o=d,this.log("Live playlist, switching playlist, load frag with next SN: "+o.sn))}o||(o=(function(u,f){return Hn(u,function(p){return p.cc<f?1:p.cc>f?-1:0})})(i,a.cc),o&&this.log("Live playlist, switching playlist, load frag with same CC: "+o.sn))}}else{var h=this.hls.liveSyncPosition;h!==null&&(o=this.getFragmentAtPosition(h,this.bitrateTest?e.fragmentEnd:e.edge,e))}return o},t.getFragmentAtPosition=function(e,i,a){var o,l=this.config,d=this.fragPrevious,h=a.fragments,u=a.endSN,f=a.fragmentHint,p=l.maxFragLookUpTolerance,m=a.partList,v=!!(l.lowLatencyMode&&m!=null&&m.length&&f);if(v&&f&&!this.bitrateTest&&(h=h.concat(f),u=f.sn),o=e<i?cr(d,h,e,e>i-p?0:p):h[h.length-1]){var y=o.sn-a.startSN,E=this.fragmentTracker.getState(o);if((E===hr||E===Ye&&o.gap)&&(d=o),d&&o.sn===d.sn&&(!v||m[0].fragment.sn>o.sn)&&d&&o.level===d.level){var b=h[y+1];o=o.sn<u&&this.fragmentTracker.getState(b)!==hr?b:null}}return o},t.synchronizeToLiveEdge=function(e){var i=this.config,a=this.media;if(a){var o=this.hls.liveSyncPosition,l=a.currentTime,d=e.fragments[0].start,h=e.edge,u=l>=d-i.maxFragLookUpTolerance&&l<=h;if(o!==null&&a.duration>o&&(l<o||!u)){var f=i.liveMaxLatencyDuration!==void 0?i.liveMaxLatencyDuration:i.liveMaxLatencyDurationCount*e.targetduration;(!u&&a.readyState<4||l<h-f)&&(this.loadedmetadata||(this.nextLoadPosition=o),a.readyState&&(this.warn("Playback: "+l.toFixed(3)+" is located too far from the end of live sliding playlist: "+h+", reset currentTime to : "+o.toFixed(3)),a.currentTime=o))}}},t.alignPlaylists=function(e,i){var a=this.levels,o=this.levelLastLoaded,l=this.fragPrevious,d=o!==null?a[o]:null,h=e.fragments.length;if(!h)return this.warn("No fragments in live playlist"),0;var u=e.fragments[0].start,f=!i,p=e.alignedSliding&&Z(u);if(f||!p&&!u){dc(l,d,e);var m=e.fragments[0].start;return this.log("Live playlist sliding: "+m.toFixed(2)+" start-sn: "+(i?i.startSN:"na")+"->"+e.startSN+" prev-sn: "+(l?l.sn:"na")+" fragments: "+h),m}return u},t.waitForCdnTuneIn=function(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)},t.setStartPosition=function(e,i){var a=this.startPosition;if(a<i&&(a=-1),a===-1||this.lastCurrentTime===-1){var o=this.startTimeOffset!==null,l=o?this.startTimeOffset:e.startTimeOffset;l!==null&&Z(l)?(a=i+l,l<0&&(a+=e.totalduration),a=Math.min(Math.max(i,a),i+e.totalduration),this.log("Start time offset "+l+" found in "+(o?"multivariant":"media")+" playlist, adjust startPosition to "+a),this.startPosition=a):e.live?a=this.hls.liveSyncPosition||i:this.startPosition=a=0,this.lastCurrentTime=a}this.nextLoadPosition=a},t.getLoadPosition=function(){var e=this.media,i=0;return this.loadedmetadata&&e?i=e.currentTime:this.nextLoadPosition&&(i=this.nextLoadPosition),i},t.handleFragLoadAborted=function(e,i){this.transmuxer&&e.sn!=="initSegment"&&e.stats.aborted&&(this.warn("Fragment "+e.sn+(i?" part "+i.index:"")+" of level "+e.level+" was aborted"),this.resetFragmentLoading(e))},t.resetFragmentLoading=function(e){this.fragCurrent&&(this.fragContextChanged(e)||this.state===Ve)||(this.state=ot)},t.onFragmentOrKeyLoadError=function(e,i){if(i.chunkMeta&&!i.frag){var a=this.getCurrentContext(i.chunkMeta);a&&(i.frag=a.frag)}var o=i.frag;if(o&&o.type===e&&this.levels)if(this.fragContextChanged(o)){var l;this.warn("Frag load error must match current frag to retry "+o.url+" > "+((l=this.fragCurrent)==null?void 0:l.url))}else{var d=i.details===F.FRAG_GAP;d&&this.fragmentTracker.fragBuffered(o,!0);var h=i.errorAction,u=h||{},f=u.action,p=u.retryCount,m=p===void 0?0:p,v=u.retryConfig;if(h&&f===Gr&&v){var y;this.resetStartWhenNotLoaded((y=this.levelLastLoaded)!=null?y:o.level);var E=Yi(v,m);this.warn("Fragment "+o.sn+" of "+e+" "+o.level+" errored with "+i.details+", retrying loading "+(m+1)+"/"+v.maxNumRetry+" in "+E+"ms"),h.resolved=!0,this.retryDate=self.performance.now()+E,this.state=Ve}else v&&h?(this.resetFragmentErrors(e),m<v.maxNumRetry?d||(h.resolved=!0):T.warn(i.details+" reached or exceeded max retry ("+m+")")):h?.action===fe?this.state=Te:this.state=qe;this.tickImmediate()}},t.reduceLengthAndFlushBuffer=function(e){if(this.state===Ae||this.state===_r){var i=e.parent,a=this.getFwdBufferInfo(this.mediaBuffer,i),o=a&&a.len>.5;o&&this.reduceMaxBufferLength(a.len);var l=!o;return l&&this.warn("Buffer full error while media.currentTime is not buffered, flush "+i+" buffer"),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),l}return!1},t.resetFragmentErrors=function(e){e===se&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==Wt&&(this.state=ot)},t.afterBufferFlushed=function(e,i,a){if(e){var o=It.getBuffered(e);this.fragmentTracker.detectEvictedFragments(i,o,a),this.state===gr&&this.resetLoadingState()}},t.resetLoadingState=function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=ot},t.resetStartWhenNotLoaded=function(e){if(!this.loadedmetadata){this.startFragRequested=!1;var i=this.levels?this.levels[e].details:null;i!=null&&i.live?(this.startPosition=-1,this.setStartPosition(i,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}},t.resetWhenMissingContext=function(e){var i;this.warn("The loading context changed while buffering fragment "+e.sn+" of level "+e.level+". This chunk will not be buffered."),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded((i=this.levelLastLoaded)!=null?i:e.level),this.resetLoadingState()},t.removeUnbufferedFrags=function(e){e===void 0&&(e=0),this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)},t.updateLevelTiming=function(e,i,a,o){var l,d=this,h=a.details;if(h){if(Object.keys(e.elementaryStreams).reduce(function(f,p){var m=e.elementaryStreams[p];if(m){var v=m.endPTS-m.startPTS;if(v<=0)return d.warn("Could not parse fragment "+e.sn+" "+p+" duration reliably ("+v+")"),f||!1;var y=o?0:Fn(h,e,m.startPTS,m.endPTS,m.startDTS,m.endDTS);return d.hls.trigger(w.LEVEL_PTS_UPDATED,{details:h,level:a,drift:y,type:p,frag:e,start:m.startPTS,end:m.endPTS}),!0}return f},!1))a.fragmentError=0;else if(((l=this.transmuxer)==null?void 0:l.error)===null){var u=new Error("Found no media in fragment "+e.sn+" of level "+e.level+" resetting transmuxer to fallback to playlist timing");if(a.fragmentError===0&&(a.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(u.message),this.hls.trigger(w.ERROR,{type:J.MEDIA_ERROR,details:F.FRAG_PARSING_ERROR,fatal:!1,error:u,frag:e,reason:"Found no media in msn "+e.sn+' of level "'+a.url+'"'}),!this.hls)return;this.resetTransmuxer()}this.state=_r,this.hls.trigger(w.FRAG_PARSED,{frag:e,part:i})}else this.warn("level.details undefined")},t.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},t.recoverWorkerError=function(e){var i,a,o;e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded((i=(a=this.levelLastLoaded)!=null?a:(o=this.fragCurrent)==null?void 0:o.level)!=null?i:0),this.resetLoadingState())},X(n,[{key:"state",get:function(){return this._state},set:function(e){var i=this._state;i!==e&&(this._state=e,this.log(i+"->"+e))}}]),n})(lc);function Zn(){return self.SourceBuffer||self.WebKitSourceBuffer}function le(s,n){return s===void 0&&(s=""),n===void 0&&(n=9e4),{type:s,id:-1,pid:-1,inputTimeScale:n,sequenceNumber:-1,samples:[],dropped:0}}var Jn=(function(){function s(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}var n=s.prototype;return n.resetInitSegment=function(t,e,i,a){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},n.resetTimeStamp=function(t){this.initPTS=t,this.resetContiguity()},n.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},n.canParse=function(t,e){return!1},n.appendFrame=function(t,e,i){},n.demux=function(t,e){this.cachedData&&(t=Se(this.cachedData,t),this.cachedData=null);var i,a=Or(t,0),o=a?a.length:0,l=this._audioTrack,d=this._id3Track,h=a?(function(m){for(var v=ln(m),y=0;y<v.length;y++){var E=v[y];if(sn(E))return Pl(E)}})(a):void 0,u=t.length;for((this.basePTS===null||this.frameIndex===0&&Z(h))&&(this.basePTS=pc(h,e,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),a&&a.length>0&&d.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:a,type:or,duration:Number.POSITIVE_INFINITY});o<u;){if(this.canParse(t,o)){var f=this.appendFrame(l,t,o);f?(this.frameIndex++,this.lastPTS=f.sample.pts,i=o+=f.length):o=u}else Tl(t,o)?(a=Or(t,o),d.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:a,type:or,duration:Number.POSITIVE_INFINITY}),i=o+=a.length):o++;if(o===u&&i!==u){var p=Le(t,i);this.cachedData?this.cachedData=Se(this.cachedData,p):this.cachedData=p}}return{audioTrack:l,videoTrack:le(),id3Track:d,textTrack:le()}},n.demuxSampleAes=function(t,e,i){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},n.flush=function(t){var e=this.cachedData;return e&&(this.cachedData=null,this.demux(e,0)),{audioTrack:this._audioTrack,videoTrack:le(),id3Track:this._id3Track,textTrack:le()}},n.destroy=function(){},s})(),pc=function(s,n,t){return Z(s)?90*s:9e4*n+(t?9e4*t.baseTime/t.timescale:0)};function jn(s,n){return s[n]===255&&(246&s[n+1])==240}function $n(s,n){return 1&s[n+1]?7:9}function ji(s,n){return(3&s[n+3])<<11|s[n+4]<<3|(224&s[n+5])>>>5}function Wr(s,n){return n+1<s.length&&jn(s,n)}function Ac(s,n){if(Wr(s,n)){var t=$n(s,n);if(n+t>=s.length)return!1;var e=ji(s,n);if(e<=t)return!1;var i=n+e;return i===s.length||Wr(s,i)}return!1}function to(s,n,t,e,i){if(!s.samplerate){var a=(function(o,l,d,h){var u,f,p,m,v=navigator.userAgent.toLowerCase(),y=h,E=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];u=1+((192&l[d+2])>>>6);var b=(60&l[d+2])>>>2;if(!(b>E.length-1))return p=(1&l[d+2])<<2,p|=(192&l[d+3])>>>6,T.log("manifest codec:"+h+", ADTS type:"+u+", samplingIndex:"+b),/firefox/i.test(v)?b>=6?(u=5,m=new Array(4),f=b-3):(u=2,m=new Array(2),f=b):v.indexOf("android")!==-1?(u=2,m=new Array(2),f=b):(u=5,m=new Array(4),h&&(h.indexOf("mp4a.40.29")!==-1||h.indexOf("mp4a.40.5")!==-1)||!h&&b>=6?f=b-3:((h&&h.indexOf("mp4a.40.2")!==-1&&(b>=6&&p===1||/vivaldi/i.test(v))||!h&&p===1)&&(u=2,m=new Array(2)),f=b)),m[0]=u<<3,m[0]|=(14&b)>>1,m[1]|=(1&b)<<7,m[1]|=p<<3,u===5&&(m[1]|=(14&f)>>1,m[2]=(1&f)<<7,m[2]|=8,m[3]=0),{config:m,samplerate:E[b],channelCount:p,codec:"mp4a.40."+u,manifestCodec:y};o.trigger(w.ERROR,{type:J.MEDIA_ERROR,details:F.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+b})})(n,t,e,i);if(!a)return;s.config=a.config,s.samplerate=a.samplerate,s.channelCount=a.channelCount,s.codec=a.codec,s.manifestCodec=a.manifestCodec,T.log("parsed codec:"+s.codec+", rate:"+a.samplerate+", channels:"+a.channelCount)}}function eo(s){return 9216e4/s}function ro(s,n,t,e,i){var a,o=e+i*eo(s.samplerate),l=(function(v,y){var E=$n(v,y);if(y+E<=v.length){var b=ji(v,y)-E;if(b>0)return{headerLength:E,frameLength:b}}})(n,t);if(l){var d=l.frameLength,h=l.headerLength,u=h+d,f=Math.max(0,t+u-n.length);f?(a=new Uint8Array(u-h)).set(n.subarray(t+h,n.length),0):a=n.subarray(t+h,t+u);var p={unit:a,pts:o};return f||s.samples.push(p),{sample:p,length:u,missing:f}}var m=n.length-t;return(a=new Uint8Array(m)).set(n.subarray(t,n.length),0),{sample:{unit:a,pts:o},length:m,missing:-1}}var mc=(function(s){function n(e,i){var a;return(a=s.call(this)||this).observer=void 0,a.config=void 0,a.observer=e,a.config=i,a}Et(n,s);var t=n.prototype;return t.resetInitSegment=function(e,i,a,o){s.prototype.resetInitSegment.call(this,e,i,a,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:i,duration:o,inputTimeScale:9e4,dropped:0}},n.probe=function(e){if(!e)return!1;for(var i=(Or(e,0)||[]).length,a=e.length;i<a;i++)if(Ac(e,i))return T.log("ADTS sync word found !"),!0;return!1},t.canParse=function(e,i){return(function(a,o){return(function(l,d){return d+5<l.length})(a,o)&&jn(a,o)&&ji(a,o)<=a.length-o})(e,i)},t.appendFrame=function(e,i,a){to(e,this.observer,i,a,e.manifestCodec);var o=ro(e,i,a,this.basePTS,this.frameIndex);if(o&&o.missing===0)return o},n})(Jn),vc=/\/emsg[-/]ID3/i,bc=(function(){function s(t,e){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=e}var n=s.prototype;return n.resetTimeStamp=function(){},n.resetInitSegment=function(t,e,i,a){var o=this.videoTrack=le("video",1),l=this.audioTrack=le("audio",1),d=this.txtTrack=le("text",1);if(this.id3Track=le("id3",1),this.timeOffset=0,t!=null&&t.byteLength){var h=un(t);if(h.video){var u=h.video,f=u.id,p=u.timescale,m=u.codec;o.id=f,o.timescale=d.timescale=p,o.codec=m}if(h.audio){var v=h.audio,y=v.id,E=v.timescale,b=v.codec;l.id=y,l.timescale=E,l.codec=b}d.id=cn.text,o.sampleDuration=0,o.duration=l.duration=a}},n.resetContiguity=function(){this.remainderData=null},s.probe=function(t){return st(t=t.length>16384?t.subarray(0,16384):t,["moof"]).length>0},n.demux=function(t,e){this.timeOffset=e;var i=t,a=this.videoTrack,o=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=Se(this.remainderData,t));var l=(function(h){var u={valid:null,remainder:null},f=st(h,["moof"]);if(!f)return u;if(f.length<2)return u.remainder=h,u;var p=f[f.length-1];return u.valid=Le(h,0,p.byteOffset-8),u.remainder=Le(h,p.byteOffset-8),u})(i);this.remainderData=l.remainder,a.samples=l.valid||new Uint8Array}else a.samples=i;var d=this.extractID3Track(a,e);return o.samples=fn(e,a),{videoTrack:a,audioTrack:this.audioTrack,id3Track:d,textTrack:this.txtTrack}},n.flush=function(){var t=this.timeOffset,e=this.videoTrack,i=this.txtTrack;e.samples=this.remainderData||new Uint8Array,this.remainderData=null;var a=this.extractID3Track(e,this.timeOffset);return i.samples=fn(t,e),{videoTrack:e,audioTrack:le(),id3Track:a,textTrack:le()}},n.extractID3Track=function(t,e){var i=this.id3Track;if(t.samples.length){var a=st(t.samples,["emsg"]);a&&a.forEach(function(o){var l=(function(f){var p=f[0],m="",v="",y=0,E=0,b=0,C=0,L=0,I=0;if(p===0){for(;Rt(f.subarray(I,I+1))!=="\0";)m+=Rt(f.subarray(I,I+1)),I+=1;for(m+=Rt(f.subarray(I,I+1)),I+=1;Rt(f.subarray(I,I+1))!=="\0";)v+=Rt(f.subarray(I,I+1)),I+=1;v+=Rt(f.subarray(I,I+1)),I+=1,y=et(f,12),E=et(f,16),C=et(f,20),L=et(f,24),I=28}else if(p===1){y=et(f,I+=4);var S=et(f,I+=4),R=et(f,I+=4);for(I+=4,b=Math.pow(2,32)*S+R,Number.isSafeInteger(b)||(b=Number.MAX_SAFE_INTEGER,T.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),C=et(f,I),L=et(f,I+=4),I+=4;Rt(f.subarray(I,I+1))!=="\0";)m+=Rt(f.subarray(I,I+1)),I+=1;for(m+=Rt(f.subarray(I,I+1)),I+=1;Rt(f.subarray(I,I+1))!=="\0";)v+=Rt(f.subarray(I,I+1)),I+=1;v+=Rt(f.subarray(I,I+1)),I+=1}return{schemeIdUri:m,value:v,timeScale:y,presentationTime:b,presentationTimeDelta:E,eventDuration:C,id:L,payload:f.subarray(I,f.byteLength)}})(o);if(vc.test(l.schemeIdUri)){var d=Z(l.presentationTime)?l.presentationTime/l.timeScale:e+l.presentationTimeDelta/l.timeScale,h=l.eventDuration===4294967295?Number.POSITIVE_INFINITY:l.eventDuration/l.timeScale;h<=.001&&(h=Number.POSITIVE_INFINITY);var u=l.payload;i.samples.push({data:u,len:u.byteLength,dts:d,pts:d,type:sr,duration:h})}})}return i},n.demuxSampleAes=function(t,e,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},n.destroy=function(){},s})(),Xr=null,yc=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],wc=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Cc=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],Ec=[0,1,1,4];function io(s,n,t,e,i){if(!(t+24>n.length)){var a=ao(n,t);if(a&&t+a.frameLength<=n.length){var o=e+i*(9e4*a.samplesPerFrame/a.sampleRate),l={unit:n.subarray(t,t+a.frameLength),pts:o,dts:o};return s.config=[],s.channelCount=a.channelCount,s.samplerate=a.sampleRate,s.samples.push(l),{sample:l,length:a.frameLength,missing:0}}}}function ao(s,n){var t=s[n+1]>>3&3,e=s[n+1]>>1&3,i=s[n+2]>>4&15,a=s[n+2]>>2&3;if(t!==1&&i!==0&&i!==15&&a!==3){var o=s[n+2]>>1&1,l=s[n+3]>>6,d=1e3*yc[14*(t===3?3-e:e===3?3:4)+i-1],h=wc[3*(t===3?0:t===2?1:2)+a],u=l===3?1:2,f=Cc[t][e],p=Ec[e],m=8*f*p,v=Math.floor(f*d/h+o)*p;if(Xr===null){var y=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Xr=y?parseInt(y[1]):0}return Xr&&Xr<=87&&e===2&&d>=224e3&&l===0&&(s[n+3]=128|s[n+3]),{sampleRate:h,channelCount:u,frameLength:v,samplesPerFrame:m}}}function $i(s,n){return s[n]===255&&(224&s[n+1])==224&&(6&s[n+1])!=0}function no(s,n){return n+1<s.length&&$i(s,n)}function kc(s,n){if(n+1<s.length&&$i(s,n)){var t=ao(s,n),e=4;t!=null&&t.frameLength&&(e=t.frameLength);var i=n+e;return i===s.length||no(s,i)}return!1}var oo=(function(){function s(t){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}var n=s.prototype;return n.loadWord=function(){var t=this.data,e=this.bytesAvailable,i=t.byteLength-e,a=new Uint8Array(4),o=Math.min(4,e);if(o===0)throw new Error("no bytes available");a.set(t.subarray(i,i+o)),this.word=new DataView(a.buffer).getUint32(0),this.bitsAvailable=8*o,this.bytesAvailable-=o},n.skipBits=function(t){var e;t=Math.min(t,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,t-=(e=t>>3)<<3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)},n.readBits=function(t){var e=Math.min(this.bitsAvailable,t),i=this.word>>>32-e;if(t>32&&T.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0)this.word<<=e;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return(e=t-e)>0&&this.bitsAvailable?i<<e|this.readBits(e):i},n.skipLZ=function(){var t;for(t=0;t<this.bitsAvailable;++t)if((this.word&2147483648>>>t)!=0)return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()},n.skipUEG=function(){this.skipBits(1+this.skipLZ())},n.skipEG=function(){this.skipBits(1+this.skipLZ())},n.readUEG=function(){var t=this.skipLZ();return this.readBits(t+1)-1},n.readEG=function(){var t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)},n.readBoolean=function(){return this.readBits(1)===1},n.readUByte=function(){return this.readBits(8)},n.readUShort=function(){return this.readBits(16)},n.readUInt=function(){return this.readBits(32)},n.skipScalingList=function(t){for(var e=8,i=8,a=0;a<t;a++)i!==0&&(i=(e+this.readEG()+256)%256),e=i===0?e:i},n.readSPS=function(){var t,e,i,a=0,o=0,l=0,d=0,h=this.readUByte.bind(this),u=this.readBits.bind(this),f=this.readUEG.bind(this),p=this.readBoolean.bind(this),m=this.skipBits.bind(this),v=this.skipEG.bind(this),y=this.skipUEG.bind(this),E=this.skipScalingList.bind(this);h();var b=h();if(u(5),m(3),h(),y(),b===100||b===110||b===122||b===244||b===44||b===83||b===86||b===118||b===128){var C=f();if(C===3&&m(1),y(),y(),m(1),p())for(e=C!==3?8:12,i=0;i<e;i++)p()&&E(i<6?16:64)}y();var L=f();if(L===0)f();else if(L===1)for(m(1),v(),v(),t=f(),i=0;i<t;i++)v();y(),m(1);var I=f(),S=f(),R=u(1);R===0&&m(1),m(1),p()&&(a=f(),o=f(),l=f(),d=f());var M=[1,1];if(p()&&p())switch(h()){case 1:M=[1,1];break;case 2:M=[12,11];break;case 3:M=[10,11];break;case 4:M=[16,11];break;case 5:M=[40,33];break;case 6:M=[24,11];break;case 7:M=[20,11];break;case 8:M=[32,11];break;case 9:M=[80,33];break;case 10:M=[18,11];break;case 11:M=[15,11];break;case 12:M=[64,33];break;case 13:M=[160,99];break;case 14:M=[4,3];break;case 15:M=[3,2];break;case 16:M=[2,1];break;case 255:M=[h()<<8|h(),h()<<8|h()]}return{width:Math.ceil(16*(I+1)-2*a-2*o),height:(2-R)*(S+1)*16-(R?2:4)*(l+d),pixelRatio:M}},n.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},s})(),Ic=(function(){function s(t,e,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new Xi(e,{removePKCS7Padding:!1})}var n=s.prototype;return n.decryptBuffer=function(t){return this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer)},n.decryptAacSample=function(t,e,i){var a=this,o=t[e].unit;if(!(o.length<=16)){var l=o.subarray(16,o.length-o.length%16),d=l.buffer.slice(l.byteOffset,l.byteOffset+l.length);this.decryptBuffer(d).then(function(h){var u=new Uint8Array(h);o.set(u,16),a.decrypter.isSync()||a.decryptAacSamples(t,e+1,i)})}},n.decryptAacSamples=function(t,e,i){for(;;e++){if(e>=t.length)return void i();if(!(t[e].unit.length<32||(this.decryptAacSample(t,e,i),this.decrypter.isSync())))return}},n.getAvcEncryptedData=function(t){for(var e=16*Math.floor((t.length-48)/160)+16,i=new Int8Array(e),a=0,o=32;o<t.length-16;o+=160,a+=16)i.set(t.subarray(o,o+16),a);return i},n.getAvcDecryptedUnit=function(t,e){for(var i=new Uint8Array(e),a=0,o=32;o<t.length-16;o+=160,a+=16)t.set(i.subarray(a,a+16),o);return t},n.decryptAvcSample=function(t,e,i,a,o){var l=this,d=An(o.data),h=this.getAvcEncryptedData(d);this.decryptBuffer(h.buffer).then(function(u){o.data=l.getAvcDecryptedUnit(d,u),l.decrypter.isSync()||l.decryptAvcSamples(t,e,i+1,a)})},n.decryptAvcSamples=function(t,e,i,a){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;e++,i=0){if(e>=t.length)return void a();for(var o=t[e].units;!(i>=o.length);i++){var l=o[i];if(!(l.data.length<=48||l.type!==1&&l.type!==5||(this.decryptAvcSample(t,e,i,a,l),this.decrypter.isSync())))return}}},s})(),Ht=188,Bc=(function(){function s(t,e,i){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=t,this.config=e,this.typeSupported=i}s.probe=function(t){var e=s.syncOffset(t);return e>0&&T.warn("MPEG2-TS detected but first sync word found @ offset "+e),e!==-1},s.syncOffset=function(t){for(var e=t.length,i=Math.min(940,t.length-Ht)+1,a=0;a<i;){for(var o=!1,l=-1,d=0,h=a;h<e;h+=Ht){if(t[h]!==71){if(d)return-1;break}if(d++,l===-1&&(l=h)!==0&&(i=Math.min(l+18612,t.length-Ht)+1),o||(o=ta(t,h)===0),o&&d>1&&(l===0&&d>2||h+Ht>i))return l}a++}return-1},s.createTrack=function(t,e){return{container:t==="video"||t==="audio"?"video/mp2t":void 0,type:t,id:cn[t],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:t==="audio"?e:void 0}};var n=s.prototype;return n.resetInitSegment=function(t,e,i,a){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=s.createTrack("video"),this._audioTrack=s.createTrack("audio",a),this._id3Track=s.createTrack("id3"),this._txtTrack=s.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=e,this.videoCodec=i,this._duration=a},n.resetTimeStamp=function(){},n.resetContiguity=function(){var t=this._audioTrack,e=this._avcTrack,i=this._id3Track;t&&(t.pesData=null),e&&(e.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null},n.demux=function(t,e,i,a){var o;i===void 0&&(i=!1),a===void 0&&(a=!1),i||(this.sampleAes=null);var l=this._avcTrack,d=this._audioTrack,h=this._id3Track,u=this._txtTrack,f=l.pid,p=l.pesData,m=d.pid,v=h.pid,y=d.pesData,E=h.pesData,b=null,C=this.pmtParsed,L=this._pmtId,I=t.length;if(this.remainderData&&(I=(t=Se(this.remainderData,t)).length,this.remainderData=null),I<Ht&&!a)return this.remainderData=t,{audioTrack:d,videoTrack:l,id3Track:h,textTrack:u};var S=Math.max(0,s.syncOffset(t));(I-=(I-S)%Ht)<t.byteLength&&!a&&(this.remainderData=new Uint8Array(t.buffer,I,t.buffer.byteLength-I));for(var R=0,M=S;M<I;M+=Ht)if(t[M]===71){var Q=!!(64&t[M+1]),P=ta(t,M),U=void 0;if((48&t[M+3])>>4>1){if((U=M+5+t[M+4])===M+Ht)continue}else U=M+4;switch(P){case f:Q&&(p&&(o=_e(p))&&this.parseAVCPES(l,u,o,!1),p={data:[],size:0}),p&&(p.data.push(t.subarray(U,M+Ht)),p.size+=M+Ht-U);break;case m:if(Q){if(y&&(o=_e(y)))switch(d.segmentCodec){case"aac":this.parseAACPES(d,o);break;case"mp3":this.parseMPEGPES(d,o)}y={data:[],size:0}}y&&(y.data.push(t.subarray(U,M+Ht)),y.size+=M+Ht-U);break;case v:Q&&(E&&(o=_e(E))&&this.parseID3PES(h,o),E={data:[],size:0}),E&&(E.data.push(t.subarray(U,M+Ht)),E.size+=M+Ht-U);break;case 0:Q&&(U+=t[U]+1),L=this._pmtId=Lc(t,U);break;case L:Q&&(U+=t[U]+1);var K=Sc(t,U,this.typeSupported,i);(f=K.avc)>0&&(l.pid=f),(m=K.audio)>0&&(d.pid=m,d.segmentCodec=K.segmentCodec),(v=K.id3)>0&&(h.pid=v),b===null||C||(T.warn("MPEG-TS PMT found at "+M+" after unknown PID '"+b+"'. Backtracking to sync byte @"+S+" to parse all TS packets."),b=null,M=S-188),C=this.pmtParsed=!0;break;case 17:case 8191:break;default:b=P}}else R++;if(R>0){var H=new Error("Found "+R+" TS packet/s that do not start with 0x47");this.observer.emit(w.ERROR,w.ERROR,{type:J.MEDIA_ERROR,details:F.FRAG_PARSING_ERROR,fatal:!1,error:H,reason:H.message})}l.pesData=p,d.pesData=y,h.pesData=E;var V={audioTrack:d,videoTrack:l,id3Track:h,textTrack:u};return a&&this.extractRemainingSamples(V),V},n.flush=function(){var t,e=this.remainderData;return this.remainderData=null,t=e?this.demux(e,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t},n.extractRemainingSamples=function(t){var e,i=t.audioTrack,a=t.videoTrack,o=t.id3Track,l=t.textTrack,d=a.pesData,h=i.pesData,u=o.pesData;if(d&&(e=_e(d))?(this.parseAVCPES(a,l,e,!0),a.pesData=null):a.pesData=d,h&&(e=_e(h))){switch(i.segmentCodec){case"aac":this.parseAACPES(i,e);break;case"mp3":this.parseMPEGPES(i,e)}i.pesData=null}else h!=null&&h.size&&T.log("last AAC PES packet truncated,might overlap between fragments"),i.pesData=h;u&&(e=_e(u))?(this.parseID3PES(o,e),o.pesData=null):o.pesData=u},n.demuxSampleAes=function(t,e,i){var a=this.demux(t,i,!0,!this.config.progressive),o=this.sampleAes=new Ic(this.observer,this.config,e);return this.decrypt(a,o)},n.decrypt=function(t,e){return new Promise(function(i){var a=t.audioTrack,o=t.videoTrack;a.samples&&a.segmentCodec==="aac"?e.decryptAacSamples(a.samples,0,function(){o.samples?e.decryptAvcSamples(o.samples,0,0,function(){i(t)}):i(t)}):o.samples&&e.decryptAvcSamples(o.samples,0,0,function(){i(t)})})},n.destroy=function(){this._duration=0},n.parseAVCPES=function(t,e,i,a){var o,l=this,d=this.parseAVCNALu(t,i.data),h=this.avcSample,u=!1;i.data=null,h&&d.length&&!t.audFound&&(pr(h,t),h=this.avcSample=Zr(!1,i.pts,i.dts,"")),d.forEach(function(f){var p;switch(f.type){case 1:var m=!1;o=!0;var v,y=f.data;if(u&&y.length>4){var E=new oo(y).readSliceType();E!==2&&E!==4&&E!==7&&E!==9||(m=!0)}m&&(v=h)!=null&&v.frame&&!h.key&&(pr(h,t),h=l.avcSample=null),h||(h=l.avcSample=Zr(!0,i.pts,i.dts,"")),h.frame=!0,h.key=m;break;case 5:o=!0,(p=h)!=null&&p.frame&&!h.key&&(pr(h,t),h=l.avcSample=null),h||(h=l.avcSample=Zr(!0,i.pts,i.dts,"")),h.key=!0,h.frame=!0;break;case 6:o=!0,pn(f.data,1,i.pts,e.samples);break;case 7:if(o=!0,u=!0,!t.sps){var b=f.data,C=new oo(b).readSPS();t.width=C.width,t.height=C.height,t.pixelRatio=C.pixelRatio,t.sps=[b],t.duration=l._duration;for(var L=b.subarray(1,4),I="avc1.",S=0;S<3;S++){var R=L[S].toString(16);R.length<2&&(R="0"+R),I+=R}t.codec=I}break;case 8:o=!0,t.pps||(t.pps=[f.data]);break;case 9:o=!1,t.audFound=!0,h&&pr(h,t),h=l.avcSample=Zr(!1,i.pts,i.dts,"");break;case 12:o=!0;break;default:o=!1,h&&(h.debug+="unknown NAL "+f.type+" ")}h&&o&&h.units.push(f)}),a&&h&&(pr(h,t),this.avcSample=null)},n.getLastNalUnit=function(t){var e,i,a=this.avcSample;if(a&&a.units.length!==0||(a=t[t.length-1]),(e=a)!=null&&e.units){var o=a.units;i=o[o.length-1]}return i},n.parseAVCNALu=function(t,e){var i,a,o=e.byteLength,l=t.naluState||0,d=l,h=[],u=0,f=-1,p=0;for(l===-1&&(f=0,p=31&e[0],l=0,u=1);u<o;)if(i=e[u++],l)if(l!==1)if(i)if(i===1){if(f>=0){var m={data:e.subarray(f,u-l-1),type:p};h.push(m)}else{var v=this.getLastNalUnit(t.samples);if(v&&(d&&u<=4-d&&v.state&&(v.data=v.data.subarray(0,v.data.byteLength-d)),(a=u-l-1)>0)){var y=new Uint8Array(v.data.byteLength+a);y.set(v.data,0),y.set(e.subarray(0,a),v.data.byteLength),v.data=y,v.state=0}}u<o?(f=u,p=31&e[u],l=0):l=-1}else l=0;else l=3;else l=i?0:2;else l=i?0:1;if(f>=0&&l>=0){var E={data:e.subarray(f,o),type:p,state:l};h.push(E)}if(h.length===0){var b=this.getLastNalUnit(t.samples);if(b){var C=new Uint8Array(b.data.byteLength+e.byteLength);C.set(b.data,0),C.set(e,b.data.byteLength),b.data=C}}return t.naluState=l,h},n.parseAACPES=function(t,e){var i,a,o,l=0,d=this.aacOverFlow,h=e.data;if(d){this.aacOverFlow=null;var u=d.missing,f=d.sample.unit.byteLength;if(u===-1){var p=new Uint8Array(f+h.byteLength);p.set(d.sample.unit,0),p.set(h,f),h=p}else{var m=f-u;d.sample.unit.set(h.subarray(0,u),m),t.samples.push(d.sample),l=d.missing}}for(i=l,a=h.length;i<a-1&&!Wr(h,i);i++);if(i!==l){var v,y=i<a-1;v=y?"AAC PES did not start with ADTS header,offset:"+i:"No ADTS header found in AAC PES";var E=new Error(v);if(T.warn("parsing error: "+v),this.observer.emit(w.ERROR,w.ERROR,{type:J.MEDIA_ERROR,details:F.FRAG_PARSING_ERROR,fatal:!1,levelRetry:y,error:E,reason:v}),!y)return}if(to(t,this.observer,h,i,this.audioCodec),e.pts!==void 0)o=e.pts;else{if(!d)return void T.warn("[tsdemuxer]: AAC PES unknown PTS");var b=eo(t.samplerate);o=d.sample.pts+b}for(var C,L=0;i<a;){if(i+=(C=ro(t,h,i,o,L)).length,C.missing){this.aacOverFlow=C;break}for(L++;i<a-1&&!Wr(h,i);i++);}},n.parseMPEGPES=function(t,e){var i=e.data,a=i.length,o=0,l=0,d=e.pts;if(d!==void 0)for(;l<a;)if(no(i,l)){var h=io(t,i,l,d,o);if(!h)break;l+=h.length,o++}else l++;else T.warn("[tsdemuxer]: MPEG PES unknown PTS")},n.parseID3PES=function(t,e){if(e.pts!==void 0){var i=pt({},e,{type:this._avcTrack?sr:or,duration:Number.POSITIVE_INFINITY});t.samples.push(i)}else T.warn("[tsdemuxer]: ID3 PES unknown PTS")},s})();function Zr(s,n,t,e){return{key:s,frame:!1,pts:n,dts:t,units:[],debug:e,length:0}}function ta(s,n){return((31&s[n+1])<<8)+s[n+2]}function Lc(s,n){return(31&s[n+10])<<8|s[n+11]}function Sc(s,n,t,e){var i={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},a=n+3+((15&s[n+1])<<8|s[n+2])-4;for(n+=12+((15&s[n+10])<<8|s[n+11]);n<a;){var o=ta(s,n);switch(s[n]){case 207:if(!e){T.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:i.audio===-1&&(i.audio=o);break;case 21:i.id3===-1&&(i.id3=o);break;case 219:if(!e){T.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:i.avc===-1&&(i.avc=o);break;case 3:case 4:t.mpeg!==!0&&t.mp3!==!0?T.log("MPEG audio found, not supported in this browser"):i.audio===-1&&(i.audio=o,i.segmentCodec="mp3");break;case 36:T.warn("Unsupported HEVC stream type found")}n+=5+((15&s[n+3])<<8|s[n+4])}return i}function _e(s){var n,t,e,i,a,o=0,l=s.data;if(!s||s.size===0)return null;for(;l[0].length<19&&l.length>1;){var d=new Uint8Array(l[0].length+l[1].length);d.set(l[0]),d.set(l[1],l[0].length),l[0]=d,l.splice(1,1)}if(((n=l[0])[0]<<16)+(n[1]<<8)+n[2]===1){if((t=(n[4]<<8)+n[5])&&t>s.size-6)return null;var h=n[7];192&h&&(i=536870912*(14&n[9])+4194304*(255&n[10])+16384*(254&n[11])+128*(255&n[12])+(254&n[13])/2,64&h?i-(a=536870912*(14&n[14])+4194304*(255&n[15])+16384*(254&n[16])+128*(255&n[17])+(254&n[18])/2)>54e5&&(T.warn(Math.round((i-a)/9e4)+"s delta between PTS and DTS, align them"),i=a):a=i);var u=(e=n[8])+9;if(s.size<=u)return null;s.size-=u;for(var f=new Uint8Array(s.size),p=0,m=l.length;p<m;p++){var v=(n=l[p]).byteLength;if(u){if(u>v){u-=v;continue}n=n.subarray(u),v-=u,u=0}f.set(n,o),o+=v}return t&&(t-=e+3),{data:f,pts:i,dts:a,len:t}}return null}function pr(s,n){if(s.units.length&&s.frame){if(s.pts===void 0){var t=n.samples,e=t.length;if(!e)return void n.dropped++;var i=t[e-1];s.pts=i.pts,s.dts=i.dts}n.samples.push(s)}s.debug.length&&T.log(s.pts+"/"+s.dts+":"+s.debug)}var xc=(function(s){function n(){return s.apply(this,arguments)||this}Et(n,s);var t=n.prototype;return t.resetInitSegment=function(e,i,a,o){s.prototype.resetInitSegment.call(this,e,i,a,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:i,duration:o,inputTimeScale:9e4,dropped:0}},n.probe=function(e){if(!e)return!1;for(var i=(Or(e,0)||[]).length,a=e.length;i<a;i++)if(kc(e,i))return T.log("MPEG Audio sync word found !"),!0;return!1},t.canParse=function(e,i){return(function(a,o){return $i(a,o)&&4<=a.length-o})(e,i)},t.appendFrame=function(e,i,a){if(this.basePTS!==null)return io(e,i,a,this.basePTS,this.frameIndex)},n})(Jn),so=(function(){function s(){}return s.getSilentFrame=function(n,t){if(n==="mp4a.40.2"){if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224])}else{if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94])}},s})(),Ce=Math.pow(2,32)-1,Mt=(function(){function s(){}return s.init=function(){var n;for(n in s.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},s.types)s.types.hasOwnProperty(n)&&(s.types[n]=[n.charCodeAt(0),n.charCodeAt(1),n.charCodeAt(2),n.charCodeAt(3)]);s.HDLR_TYPES={video:new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),audio:new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0])};var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);s.STTS=s.STSC=s.STCO=new Uint8Array([0,0,0,0,0,0,0,0]),s.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),s.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),s.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),s.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var e=new Uint8Array([105,115,111,109]),i=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);s.FTYP=s.box(s.types.ftyp,e,a,e,i),s.DINF=s.box(s.types.dinf,s.box(s.types.dref,t))},s.box=function(n){for(var t=8,e=arguments.length,i=new Array(e>1?e-1:0),a=1;a<e;a++)i[a-1]=arguments[a];for(var o=i.length,l=o;o--;)t+=i[o].byteLength;var d=new Uint8Array(t);for(d[0]=t>>24&255,d[1]=t>>16&255,d[2]=t>>8&255,d[3]=255&t,d.set(n,4),o=0,t=8;o<l;o++)d.set(i[o],t),t+=i[o].byteLength;return d},s.hdlr=function(n){return s.box(s.types.hdlr,s.HDLR_TYPES[n])},s.mdat=function(n){return s.box(s.types.mdat,n)},s.mdhd=function(n,t){t*=n;var e=Math.floor(t/(Ce+1)),i=Math.floor(t%(Ce+1));return s.box(s.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,255&n,e>>24,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,85,196,0,0]))},s.mdia=function(n){return s.box(s.types.mdia,s.mdhd(n.timescale,n.duration),s.hdlr(n.type),s.minf(n))},s.mfhd=function(n){return s.box(s.types.mfhd,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n]))},s.minf=function(n){return n.type==="audio"?s.box(s.types.minf,s.box(s.types.smhd,s.SMHD),s.DINF,s.stbl(n)):s.box(s.types.minf,s.box(s.types.vmhd,s.VMHD),s.DINF,s.stbl(n))},s.moof=function(n,t,e){return s.box(s.types.moof,s.mfhd(n),s.traf(e,t))},s.moov=function(n){for(var t=n.length,e=[];t--;)e[t]=s.trak(n[t]);return s.box.apply(null,[s.types.moov,s.mvhd(n[0].timescale,n[0].duration)].concat(e).concat(s.mvex(n)))},s.mvex=function(n){for(var t=n.length,e=[];t--;)e[t]=s.trex(n[t]);return s.box.apply(null,[s.types.mvex].concat(e))},s.mvhd=function(n,t){t*=n;var e=Math.floor(t/(Ce+1)),i=Math.floor(t%(Ce+1)),a=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,n>>24&255,n>>16&255,n>>8&255,255&n,e>>24,e>>16&255,e>>8&255,255&e,i>>24,i>>16&255,i>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return s.box(s.types.mvhd,a)},s.sdtp=function(n){var t,e,i=n.samples||[],a=new Uint8Array(4+i.length);for(t=0;t<i.length;t++)e=i[t].flags,a[t+4]=e.dependsOn<<4|e.isDependedOn<<2|e.hasRedundancy;return s.box(s.types.sdtp,a)},s.stbl=function(n){return s.box(s.types.stbl,s.stsd(n),s.box(s.types.stts,s.STTS),s.box(s.types.stsc,s.STSC),s.box(s.types.stsz,s.STSZ),s.box(s.types.stco,s.STCO))},s.avc1=function(n){var t,e,i,a=[],o=[];for(t=0;t<n.sps.length;t++)i=(e=n.sps[t]).byteLength,a.push(i>>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(e));for(t=0;t<n.pps.length;t++)i=(e=n.pps[t]).byteLength,o.push(i>>>8&255),o.push(255&i),o=o.concat(Array.prototype.slice.call(e));var l=s.box(s.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|n.sps.length].concat(a).concat([n.pps.length]).concat(o))),d=n.width,h=n.height,u=n.pixelRatio[0],f=n.pixelRatio[1];return s.box(s.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,d>>8&255,255&d,h>>8&255,255&h,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l,s.box(s.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),s.box(s.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,255&u,f>>24,f>>16&255,f>>8&255,255&f])))},s.esds=function(n){var t=n.config.length;return new Uint8Array([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([t]).concat(n.config).concat([6,1,2]))},s.mp4a=function(n){var t=n.samplerate;return s.box(s.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]),s.box(s.types.esds,s.esds(n)))},s.mp3=function(n){var t=n.samplerate;return s.box(s.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,n.channelCount,0,16,0,0,0,0,t>>8&255,255&t,0,0]))},s.stsd=function(n){return n.type==="audio"?n.segmentCodec==="mp3"&&n.codec==="mp3"?s.box(s.types.stsd,s.STSD,s.mp3(n)):s.box(s.types.stsd,s.STSD,s.mp4a(n)):s.box(s.types.stsd,s.STSD,s.avc1(n))},s.tkhd=function(n){var t=n.id,e=n.duration*n.timescale,i=n.width,a=n.height,o=Math.floor(e/(Ce+1)),l=Math.floor(e%(Ce+1));return s.box(s.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,0,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,l>>24,l>>16&255,l>>8&255,255&l,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,a>>8&255,255&a,0,0]))},s.traf=function(n,t){var e=s.sdtp(n),i=n.id,a=Math.floor(t/(Ce+1)),o=Math.floor(t%(Ce+1));return s.box(s.types.traf,s.box(s.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),s.box(s.types.tfdt,new Uint8Array([1,0,0,0,a>>24,a>>16&255,a>>8&255,255&a,o>>24,o>>16&255,o>>8&255,255&o])),s.trun(n,e.length+16+20+8+16+8+8),e)},s.trak=function(n){return n.duration=n.duration||4294967295,s.box(s.types.trak,s.tkhd(n),s.mdia(n))},s.trex=function(n){var t=n.id;return s.box(s.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},s.trun=function(n,t){var e,i,a,o,l,d,h=n.samples||[],u=h.length,f=12+16*u,p=new Uint8Array(f);for(t+=8+f,p.set([n.type==="video"?1:0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,255&u,t>>>24&255,t>>>16&255,t>>>8&255,255&t],0),e=0;e<u;e++)a=(i=h[e]).duration,o=i.size,l=i.flags,d=i.cts,p.set([a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o,l.isLeading<<2|l.dependsOn,l.isDependedOn<<6|l.hasRedundancy<<4|l.paddingValue<<1|l.isNonSync,61440&l.degradPrio,15&l.degradPrio,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*e);return s.box(s.types.trun,p)},s.initSegment=function(n){s.types||s.init();var t=s.moov(n),e=new Uint8Array(s.FTYP.byteLength+t.byteLength);return e.set(s.FTYP),e.set(t,s.FTYP.byteLength),e},s})();function ea(s,n,t,e){t===void 0&&(t=1),e===void 0&&(e=!1);var i=s*n*t;return e?Math.round(i):i}function Ar(s,n){return n===void 0&&(n=!1),ea(s,1e3,1/9e4,n)}Mt.types=void 0,Mt.HDLR_TYPES=void 0,Mt.STTS=void 0,Mt.STSC=void 0,Mt.STCO=void 0,Mt.STSZ=void 0,Mt.VMHD=void 0,Mt.SMHD=void 0,Mt.STSD=void 0,Mt.FTYP=void 0,Mt.DINF=void 0;var Jr=null,ra=null,ia=(function(){function s(t,e,i,a){if(this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=t,this.config=e,this.typeSupported=i,this.ISGenerated=!1,Jr===null){var o=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Jr=o?parseInt(o[1]):0}if(ra===null){var l=navigator.userAgent.match(/Safari\/(\d+)/i);ra=l?parseInt(l[1]):0}}var n=s.prototype;return n.destroy=function(){},n.resetTimeStamp=function(t){T.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=t},n.resetNextTimestamp=function(){T.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},n.resetInitSegment=function(){T.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},n.getVideoStartPts=function(t){var e=!1,i=t.reduce(function(a,o){var l=o.pts-a;return l<-4294967296?(e=!0,Xt(a,o.pts)):l>0?a:o.pts},t[0].pts);return e&&T.debug("PTS rollover detected"),i},n.remux=function(t,e,i,a,o,l,d,h){var u,f,p,m,v,y,E=o,b=o,C=t.pid>-1,L=e.pid>-1,I=e.samples.length,S=t.samples.length>0,R=d&&I>0||I>1;if((!C||S)&&(!L||R)||this.ISGenerated||d){this.ISGenerated||(p=this.generateIS(t,e,o,l));var M,Q=this.isVideoContiguous,P=-1;if(R&&(P=(function(j){for(var q=0;q<j.length;q++)if(j[q].key)return q;return-1})(e.samples),!Q&&this.config.forceKeyFrameOnDiscontinuity))if(y=!0,P>0){T.warn("[mp4-remuxer]: Dropped "+P+" out of "+I+" video samples due to a missing keyframe");var U=this.getVideoStartPts(e.samples);e.samples=e.samples.slice(P),e.dropped+=P,M=b+=(e.samples[0].pts-U)/e.inputTimeScale}else P===-1&&(T.warn("[mp4-remuxer]: No keyframe found out of "+I+" video samples"),y=!1);if(this.ISGenerated){if(S&&R){var K=this.getVideoStartPts(e.samples),H=(Xt(t.samples[0].pts,K)-K)/e.inputTimeScale;E+=Math.max(0,H),b+=Math.max(0,-H)}if(S){if(t.samplerate||(T.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),p=this.generateIS(t,e,o,l)),f=this.remuxAudio(t,E,this.isAudioContiguous,l,L||R||h===se?b:void 0),R){var V=f?f.endPTS-f.startPTS:0;e.inputTimeScale||(T.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),p=this.generateIS(t,e,o,l)),u=this.remuxVideo(e,b,Q,V)}}else R&&(u=this.remuxVideo(e,b,Q,0));u&&(u.firstKeyFrame=P,u.independent=P!==-1,u.firstKeyFramePTS=M)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(v=lo(i,o,this._initPTS,this._initDTS)),a.samples.length&&(m=co(a,o,this._initPTS))),{audio:f,video:u,initSegment:p,independent:y,text:m,id3:v}},n.generateIS=function(t,e,i,a){var o,l,d,h=t.samples,u=e.samples,f=this.typeSupported,p={},m=this._initPTS,v=!m||a,y="audio/mp4";if(v&&(o=l=1/0),t.config&&h.length&&(t.timescale=t.samplerate,t.segmentCodec==="mp3"&&(f.mpeg?(y="audio/mpeg",t.codec=""):f.mp3&&(t.codec="mp3")),p.audio={id:"audio",container:y,codec:t.codec,initSegment:t.segmentCodec==="mp3"&&f.mpeg?new Uint8Array(0):Mt.initSegment([t]),metadata:{channelCount:t.channelCount}},v&&(d=t.inputTimeScale,m&&d===m.timescale?v=!1:o=l=h[0].pts-Math.round(d*i))),e.sps&&e.pps&&u.length&&(e.timescale=e.inputTimeScale,p.video={id:"main",container:"video/mp4",codec:e.codec,initSegment:Mt.initSegment([e]),metadata:{width:e.width,height:e.height}},v))if(d=e.inputTimeScale,m&&d===m.timescale)v=!1;else{var E=this.getVideoStartPts(u),b=Math.round(d*i);l=Math.min(l,Xt(u[0].dts,E)-b),o=Math.min(o,E-b)}if(Object.keys(p).length)return this.ISGenerated=!0,v?(this._initPTS={baseTime:o,timescale:d},this._initDTS={baseTime:l,timescale:d}):o=d=void 0,{tracks:p,initPTS:o,timescale:d}},n.remuxVideo=function(t,e,i,a){var o,l,d=t.inputTimeScale,h=t.samples,u=[],f=h.length,p=this._initPTS,m=this.nextAvcDts,v=8,y=this.videoSampleDuration,E=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,C=!1;i&&m!==null||(m=e*d-(h[0].pts-Xt(h[0].dts,h[0].pts)));for(var L=p.baseTime*d/p.timescale,I=0;I<f;I++){var S=h[I];S.pts=Xt(S.pts-L,m),S.dts=Xt(S.dts-L,m),S.dts<h[I>0?I-1:I].dts&&(C=!0)}C&&h.sort(function(oi,qo){var Ld=oi.dts-qo.dts,Sd=oi.pts-qo.pts;return Ld||Sd}),o=h[0].dts;var R=(l=h[h.length-1].dts)-o,M=R?Math.round(R/(f-1)):y||t.inputTimeScale/30;if(i){var Q=o-m,P=Q>M,U=Q<-1;if((P||U)&&(P?T.warn("AVC: "+Ar(Q,!0)+" ms ("+Q+"dts) hole between fragments detected, filling it"):T.warn("AVC: "+Ar(-Q,!0)+" ms ("+Q+"dts) overlapping between fragments detected"),!U||m>=h[0].pts)){o=m;var K=h[0].pts-Q;h[0].dts=o,h[0].pts=K,T.log("Video: First PTS/DTS adjusted: "+Ar(K,!0)+"/"+Ar(o,!0)+", delta: "+Ar(Q,!0)+" ms")}}o=Math.max(0,o);for(var H=0,V=0,j=0;j<f;j++){for(var q=h[j],W=q.units,tt=W.length,G=0,at=0;at<tt;at++)G+=W[at].data.length;V+=G,H+=tt,q.length=G,q.dts=Math.max(q.dts,o),E=Math.min(q.pts,E),b=Math.max(q.pts,b)}l=h[f-1].dts;var nt,lt=V+4*H+8;try{nt=new Uint8Array(lt)}catch(oi){this.observer.emit(w.ERROR,w.ERROR,{type:J.MUX_ERROR,details:F.REMUX_ALLOC_ERROR,fatal:!1,error:oi,bytes:lt,reason:"fail allocating video mdat "+lt});return}var At=new DataView(nt.buffer);At.setUint32(0,lt),nt.set(Mt.types.mdat,4);for(var St=!1,Ut=Number.POSITIVE_INFINITY,te=Number.POSITIVE_INFINITY,Yt=Number.NEGATIVE_INFINITY,Jt=Number.NEGATIVE_INFINITY,Lt=0;Lt<f;Lt++){for(var Ft=h[Lt],ee=Ft.units,Fe=0,Kt=0,ii=ee.length;Kt<ii;Kt++){var mr=ee[Kt],ai=mr.data,Ze=mr.data.byteLength;At.setUint32(v,Ze),v+=4,nt.set(ai,v),v+=Ze,Fe+=4+Ze}var Oe=void 0;if(Lt<f-1)y=h[Lt+1].dts-Ft.dts,Oe=h[Lt+1].pts-Ft.pts;else{var Pe=this.config,ni=Lt>0?Ft.dts-h[Lt-1].dts:M;if(Oe=Lt>0?Ft.pts-h[Lt-1].pts:M,Pe.stretchShortVideoTrack&&this.nextAudioPts!==null){var Cd=Math.floor(Pe.maxBufferHole*d),Ea=(a?E+a*d:this.nextAudioPts)-Ft.pts;Ea>Cd?((y=Ea-ni)<0?y=ni:St=!0,T.log("[mp4-remuxer]: It is approximately "+Ea/90+" ms to the next segment; using duration "+y/90+" ms for the last video frame.")):y=ni}else y=ni}var Ed=Math.round(Ft.pts-Ft.dts);Ut=Math.min(Ut,y),Yt=Math.max(Yt,y),te=Math.min(te,Oe),Jt=Math.max(Jt,Oe),u.push(new ho(Ft.key,y,Fe,Ed))}if(u.length){if(Jr){if(Jr<70){var Go=u[0].flags;Go.dependsOn=2,Go.isNonSync=0}}else if(ra&&Jt-te<Yt-Ut&&M/Yt<.025&&u[0].cts===0){T.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var ka=o,re=0,zo=u.length;re<zo;re++){var Vo=ka+u[re].duration,kd=ka+u[re].cts;if(re<zo-1){var Id=Vo+u[re+1].cts;u[re].duration=Id-kd}else u[re].duration=re?u[re-1].duration:M;u[re].cts=0,ka=Vo}}}y=St||!y?M:y,this.nextAvcDts=m=l+y,this.videoSampleDuration=y,this.isVideoContiguous=!0;var Bd={data1:Mt.moof(t.sequenceNumber++,o,pt({},t,{samples:u})),data2:nt,startPTS:E/d,endPTS:(b+y)/d,startDTS:o/d,endDTS:m/d,type:"video",hasAudio:!1,hasVideo:!0,nb:u.length,dropped:t.dropped};return t.samples=[],t.dropped=0,Bd},n.remuxAudio=function(t,e,i,a,o){var l=t.inputTimeScale,d=l/(t.samplerate?t.samplerate:l),h=t.segmentCodec==="aac"?1024:1152,u=h*d,f=this._initPTS,p=t.segmentCodec==="mp3"&&this.typeSupported.mpeg,m=[],v=o!==void 0,y=t.samples,E=p?0:8,b=this.nextAudioPts||-1,C=e*l,L=f.baseTime*l/f.timescale;if(this.isAudioContiguous=i=i||y.length&&b>0&&(a&&Math.abs(C-b)<9e3||Math.abs(Xt(y[0].pts-L,C)-b)<20*u),y.forEach(function(Kt){Kt.pts=Xt(Kt.pts-L,C)}),!i||b<0){if(y=y.filter(function(Kt){return Kt.pts>=0}),!y.length)return;b=o===0?0:a&&!v?Math.max(0,C):y[0].pts}if(t.segmentCodec==="aac")for(var I=this.config.maxAudioFramesDrift,S=0,R=b;S<y.length;S++){var M=y[S],Q=M.pts,P=Q-R,U=Math.abs(1e3*P/l);if(P<=-I*u&&v)S===0&&(T.warn("Audio frame @ "+(Q/l).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*P/l)+" ms."),this.nextAudioPts=b=R=Q);else if(P>=I*u&&U<1e4&&v){var K=Math.round(P/u);(R=Q-K*u)<0&&(K--,R+=u),S===0&&(this.nextAudioPts=b=R),T.warn("[mp4-remuxer]: Injecting "+K+" audio frame @ "+(R/l).toFixed(3)+"s due to "+Math.round(1e3*P/l)+" ms gap.");for(var H=0;H<K;H++){var V=Math.max(R,0),j=so.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);j||(T.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),j=M.unit.subarray()),y.splice(S,0,{unit:j,pts:V}),R+=u,S++}}M.pts=R,R+=u}for(var q,W=null,tt=null,G=0,at=y.length;at--;)G+=y[at].unit.byteLength;for(var nt=0,lt=y.length;nt<lt;nt++){var At=y[nt],St=At.unit,Ut=At.pts;if(tt!==null)m[nt-1].duration=Math.round((Ut-tt)/d);else{if(i&&t.segmentCodec==="aac"&&(Ut=b),W=Ut,!(G>0))return;G+=E;try{q=new Uint8Array(G)}catch(Kt){this.observer.emit(w.ERROR,w.ERROR,{type:J.MUX_ERROR,details:F.REMUX_ALLOC_ERROR,fatal:!1,error:Kt,bytes:G,reason:"fail allocating audio mdat "+G});return}p||(new DataView(q.buffer).setUint32(0,G),q.set(Mt.types.mdat,4))}q.set(St,E);var te=St.byteLength;E+=te,m.push(new ho(!0,h,te,0)),tt=Ut}var Yt=m.length;if(Yt){var Jt=m[m.length-1];this.nextAudioPts=b=tt+d*Jt.duration;var Lt=p?new Uint8Array(0):Mt.moof(t.sequenceNumber++,W/d,pt({},t,{samples:m}));t.samples=[];var Ft=W/l,ee=b/l,Fe={data1:Lt,data2:q,startPTS:Ft,endPTS:ee,startDTS:Ft,endDTS:ee,type:"audio",hasAudio:!0,hasVideo:!1,nb:Yt};return this.isAudioContiguous=!0,Fe}},n.remuxEmptyAudio=function(t,e,i,a){var o=t.inputTimeScale,l=o/(t.samplerate?t.samplerate:o),d=this.nextAudioPts,h=this._initDTS,u=9e4*h.baseTime/h.timescale,f=(d!==null?d:a.startDTS*o)+u,p=a.endDTS*o+u,m=1024*l,v=Math.ceil((p-f)/m),y=so.getSilentFrame(t.manifestCodec||t.codec,t.channelCount);if(T.warn("[mp4-remuxer]: remux empty Audio"),y){for(var E=[],b=0;b<v;b++){var C=f+b*m;E.push({unit:y,pts:C,dts:C})}return t.samples=E,this.remuxAudio(t,e,i,!1)}T.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec")},s})();function Xt(s,n){var t;if(n===null)return s;for(t=n<s?-8589934592:8589934592;Math.abs(s-n)>4294967296;)s+=t;return s}function lo(s,n,t,e){var i=s.samples.length;if(i){for(var a=s.inputTimeScale,o=0;o<i;o++){var l=s.samples[o];l.pts=Xt(l.pts-t.baseTime*a/t.timescale,n*a)/a,l.dts=Xt(l.dts-e.baseTime*a/e.timescale,n*a)/a}var d=s.samples;return s.samples=[],{samples:d}}}function co(s,n,t){var e=s.samples.length;if(e){for(var i=s.inputTimeScale,a=0;a<e;a++){var o=s.samples[a];o.pts=Xt(o.pts-t.baseTime*i/t.timescale,n*i)/i}s.samples.sort(function(d,h){return d.pts-h.pts});var l=s.samples;return s.samples=[],{samples:l}}}var me,ho=function(s,n,t,e){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=n,this.size=t,this.cts=e,this.flags=new Tc(s)},Tc=function(s){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=s?2:1,this.isNonSync=s?0:1},Dc=(function(){function s(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}var n=s.prototype;return n.destroy=function(){},n.resetTimeStamp=function(t){this.initPTS=t,this.lastEndTime=null},n.resetNextTimestamp=function(){this.lastEndTime=null},n.resetInitSegment=function(t,e,i,a){this.audioCodec=e,this.videoCodec=i,this.generateInitSegment((function(o,l){if(!o||!l)return o;var d=l.keyId;return d&&l.isCommonEncryption&&st(o,["moov","trak"]).forEach(function(h){var u=st(h,["mdia","minf","stbl","stsd"])[0].subarray(8),f=st(u,["enca"]),p=f.length>0;p||(f=st(u,["encv"])),f.forEach(function(m){st(p?m.subarray(28):m.subarray(78),["sinf"]).forEach(function(v){var y=gn(v);if(y){var E=y.subarray(8,24);E.some(function(b){return b!==0})||(T.log("[eme] Patching keyId in 'enc"+(p?"a":"v")+">sinf>>tenc' box: "+ne(E)+" -> "+ne(d)),y.set(d,8))}})})}),o})(t,a)),this.emitInitSegment=!0},n.generateInitSegment=function(t){var e=this.audioCodec,i=this.videoCodec;if(t==null||!t.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var a=this.initData=un(t);e||(e=uo(a.audio,Dt)),i||(i=uo(a.video,Qt));var o={};a.audio&&a.video?o.audiovideo={container:"video/mp4",codec:e+","+i,initSegment:t,id:"main"}:a.audio?o.audio={container:"audio/mp4",codec:e,initSegment:t,id:"audio"}:a.video?o.video={container:"video/mp4",codec:i,initSegment:t,id:"main"}:T.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=o},n.remux=function(t,e,i,a,o,l){var d,h,u=this.initPTS,f=this.lastEndTime,p={audio:void 0,video:void 0,text:a,id3:i,initSegment:void 0};Z(f)||(f=this.lastEndTime=o||0);var m=e.samples;if(m==null||!m.length)return p;var v={initPTS:void 0,timescale:1},y=this.initData;if((d=y)!=null&&d.length||(this.generateInitSegment(m),y=this.initData),(h=y)==null||!h.length)return T.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),p;this.emitInitSegment&&(v.tracks=this.initTracks,this.emitInitSegment=!1);var E=(function(P,U){for(var K=0,H=0,V=0,j=st(P,["moof","traf"]),q=0;q<j.length;q++){var W=j[q],tt=st(W,["tfhd"])[0],G=U[et(tt,4)];if(G){var at=G.default,nt=et(tt,0)|at?.flags,lt=at?.duration;8&nt&&(lt=et(tt,2&nt?12:8));for(var At=G.timescale||9e4,St=st(W,["trun"]),Ut=0;Ut<St.length;Ut++)!(K=Hl(St[Ut]))&<&&(K=lt*et(St[Ut],4)),G.type===Qt?H+=K/At:G.type===Dt&&(V+=K/At)}}if(H===0&&V===0){for(var te=0,Yt=st(P,["sidx"]),Jt=0;Jt<Yt.length;Jt++){var Lt=Nl(Yt[Jt]);Lt!=null&&Lt.references&&(te+=Lt.references.reduce(function(Ft,ee){return Ft+ee.info.duration||0},0))}return te}return H||V})(m,y),b=(function(P,U){return st(U,["moof","traf"]).reduce(function(K,H){var V=st(H,["tfdt"])[0],j=V[0],q=st(H,["tfhd"]).reduce(function(W,tt){var G=P[et(tt,4)];if(G){var at=et(V,4);if(j===1){if(at===Ur)return T.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),W;at*=Ur+1,at+=et(V,8)}var nt=at/(G.timescale||9e4);if(isFinite(nt)&&(W===null||nt<W))return nt}return W},null);return q!==null&&isFinite(q)&&(K===null||q<K)?q:K},null)})(y,m),C=b===null?o:b;((function(P,U,K,H){if(P===null)return!0;var V=Math.max(H,1),j=U-P.baseTime/P.timescale;return Math.abs(j-K)>V})(u,C,o,E)||v.timescale!==u.timescale&&l)&&(v.initPTS=C-o,u&&u.timescale===1&&T.warn("Adjusting initPTS by "+(v.initPTS-u.baseTime)),this.initPTS=u={baseTime:v.initPTS,timescale:1});var L=t?C-u.baseTime/u.timescale:f,I=L+E;(function(P,U,K){st(U,["moof","traf"]).forEach(function(H){st(H,["tfhd"]).forEach(function(V){var j=P[et(V,4)];if(j){var q=j.timescale||9e4;st(H,["tfdt"]).forEach(function(W){var tt=W[0],G=et(W,4);if(tt===0)G-=K*q,Ti(W,4,G=Math.max(G,0));else{G*=Math.pow(2,32),G+=et(W,8),G-=K*q,G=Math.max(G,0);var at=Math.floor(G/(Ur+1)),nt=Math.floor(G%(Ur+1));Ti(W,4,at),Ti(W,8,nt)}})}})})})(y,m,u.baseTime/u.timescale),E>0?this.lastEndTime=I:(T.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var S=!!y.audio,R=!!y.video,M="";S&&(M+="audio"),R&&(M+="video");var Q={data1:m,startPTS:L,startDTS:L,endPTS:I,endDTS:I,type:M,hasAudio:S,hasVideo:R,nb:1,dropped:0};return p.audio=Q.type==="audio"?Q:void 0,p.video=Q.type!=="audio"?Q:void 0,p.initSegment=v,p.id3=lo(i,o,u,u),a.samples.length&&(p.text=co(a,o,u)),p},s})();function uo(s,n){var t=s?.codec;return t&&t.length>4?t:t==="hvc1"||t==="hev1"?"hvc1.1.6.L120.90":t==="av01"?"av01.0.04M.08":t==="avc1"||n===Qt?"avc1.42e01e":"mp4a.40.5"}try{me=self.performance.now.bind(self.performance)}catch{T.debug("Unable to use Performance API on this environment"),me=typeof self<"u"&&self.Date.now}var aa=[{demux:bc,remux:Dc},{demux:Bc,remux:ia},{demux:mc,remux:ia},{demux:xc,remux:ia}],na=(function(){function s(t,e,i,a,o){this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=t,this.typeSupported=e,this.config=i,this.vendor=a,this.id=o}var n=s.prototype;return n.configure=function(t){this.transmuxConfig=t,this.decrypter&&this.decrypter.reset()},n.push=function(t,e,i,a){var o=this,l=i.transmuxing;l.executeStart=me();var d=new Uint8Array(t),h=this.currentTransmuxState,u=this.transmuxConfig;a&&(this.currentTransmuxState=a);var f=a||h,p=f.contiguous,m=f.discontinuity,v=f.trackSwitch,y=f.accurateTimeOffset,E=f.timeOffset,b=f.initSegmentChange,C=u.audioCodec,L=u.videoCodec,I=u.defaultInitPts,S=u.duration,R=u.initSegmentData,M=(function(j,q){var W=null;return j.byteLength>0&&q!=null&&q.key!=null&&q.iv!==null&&q.method!=null&&(W=q),W})(d,e);if(M&&M.method==="AES-128"){var Q=this.getDecrypter();if(!Q.isSync())return this.decryptionPromise=Q.webCryptoDecrypt(d,M.key.buffer,M.iv.buffer).then(function(j){var q=o.push(j,null,i);return o.decryptionPromise=null,q}),this.decryptionPromise;var P=Q.softwareDecrypt(d,M.key.buffer,M.iv.buffer);if(i.part>-1&&(P=Q.flush()),!P)return l.executeEnd=me(),oa(i);d=new Uint8Array(P)}var U=this.needsProbing(m,v);if(U){var K=this.configureTransmuxer(d);if(K)return T.warn("[transmuxer] "+K.message),this.observer.emit(w.ERROR,w.ERROR,{type:J.MEDIA_ERROR,details:F.FRAG_PARSING_ERROR,fatal:!1,error:K,reason:K.message}),l.executeEnd=me(),oa(i)}(m||v||b||U)&&this.resetInitSegment(R,C,L,S,e),(m||b||U)&&this.resetInitialTimestamp(I),p||this.resetContiguity();var H=this.transmux(d,M,E,y,i),V=this.currentTransmuxState;return V.contiguous=!0,V.discontinuity=!1,V.trackSwitch=!1,l.executeEnd=me(),H},n.flush=function(t){var e=this,i=t.transmuxing;i.executeStart=me();var a=this.decrypter,o=this.currentTransmuxState,l=this.decryptionPromise;if(l)return l.then(function(){return e.flush(t)});var d=[],h=o.timeOffset;if(a){var u=a.flush();u&&d.push(this.push(u,null,t))}var f=this.demuxer,p=this.remuxer;if(!f||!p)return i.executeEnd=me(),[oa(t)];var m=f.flush(h);return De(m)?m.then(function(v){return e.flushRemux(d,v,t),d}):(this.flushRemux(d,m,t),d)},n.flushRemux=function(t,e,i){var a=e.audioTrack,o=e.videoTrack,l=e.id3Track,d=e.textTrack,h=this.currentTransmuxState,u=h.accurateTimeOffset,f=h.timeOffset;T.log("[transmuxer.ts]: Flushed fragment "+i.sn+(i.part>-1?" p: "+i.part:"")+" of level "+i.level);var p=this.remuxer.remux(a,o,l,d,f,u,!0,this.id);t.push({remuxResult:p,chunkMeta:i}),i.transmuxing.executeEnd=me()},n.resetInitialTimestamp=function(t){var e=this.demuxer,i=this.remuxer;e&&i&&(e.resetTimeStamp(t),i.resetTimeStamp(t))},n.resetContiguity=function(){var t=this.demuxer,e=this.remuxer;t&&e&&(t.resetContiguity(),e.resetNextTimestamp())},n.resetInitSegment=function(t,e,i,a,o){var l=this.demuxer,d=this.remuxer;l&&d&&(l.resetInitSegment(t,e,i,a),d.resetInitSegment(t,e,i,o))},n.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},n.transmux=function(t,e,i,a,o){return e&&e.method==="SAMPLE-AES"?this.transmuxSampleAes(t,e,i,a,o):this.transmuxUnencrypted(t,i,a,o)},n.transmuxUnencrypted=function(t,e,i,a){var o=this.demuxer.demux(t,e,!1,!this.config.progressive),l=o.audioTrack,d=o.videoTrack,h=o.id3Track,u=o.textTrack;return{remuxResult:this.remuxer.remux(l,d,h,u,e,i,!1,this.id),chunkMeta:a}},n.transmuxSampleAes=function(t,e,i,a,o){var l=this;return this.demuxer.demuxSampleAes(t,e,i).then(function(d){return{remuxResult:l.remuxer.remux(d.audioTrack,d.videoTrack,d.id3Track,d.textTrack,i,a,!1,l.id),chunkMeta:o}})},n.configureTransmuxer=function(t){for(var e,i=this.config,a=this.observer,o=this.typeSupported,l=this.vendor,d=0,h=aa.length;d<h;d++)if(aa[d].demux.probe(t)){e=aa[d];break}if(!e)return new Error("Failed to find demuxer by probing fragment data");var u=this.demuxer,f=this.remuxer,p=e.remux,m=e.demux;f&&f instanceof p||(this.remuxer=new p(a,i,o,l)),u&&u instanceof m||(this.demuxer=new m(a,i,o),this.probe=m.probe)},n.needsProbing=function(t,e){return!this.demuxer||!this.remuxer||t||e},n.getDecrypter=function(){var t=this.decrypter;return t||(t=this.decrypter=new Xi(this.config)),t},s})(),oa=function(s){return{remuxResult:{},chunkMeta:s}};function De(s){return"then"in s&&s.then instanceof Function}var Rc=function(s,n,t,e,i){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=s,this.videoCodec=n,this.initSegmentData=t,this.duration=e,this.defaultInitPts=i||null},Mc=function(s,n,t,e,i,a){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=s,this.contiguous=n,this.accurateTimeOffset=t,this.trackSwitch=e,this.timeOffset=i,this.initSegmentChange=a},go={exports:{}};(function(s){var n=Object.prototype.hasOwnProperty,t="~";function e(){}function i(d,h,u){this.fn=d,this.context=h,this.once=u||!1}function a(d,h,u,f,p){if(typeof u!="function")throw new TypeError("The listener must be a function");var m=new i(u,f||d,p),v=t?t+h:h;return d._events[v]?d._events[v].fn?d._events[v]=[d._events[v],m]:d._events[v].push(m):(d._events[v]=m,d._eventsCount++),d}function o(d,h){--d._eventsCount==0?d._events=new e:delete d._events[h]}function l(){this._events=new e,this._eventsCount=0}Object.create&&(e.prototype=Object.create(null),new e().__proto__||(t=!1)),l.prototype.eventNames=function(){var d,h,u=[];if(this._eventsCount===0)return u;for(h in d=this._events)n.call(d,h)&&u.push(t?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(d){var h=t?t+d:d,u=this._events[h];if(!u)return[];if(u.fn)return[u.fn];for(var f=0,p=u.length,m=new Array(p);f<p;f++)m[f]=u[f].fn;return m},l.prototype.listenerCount=function(d){var h=t?t+d:d,u=this._events[h];return u?u.fn?1:u.length:0},l.prototype.emit=function(d,h,u,f,p,m){var v=t?t+d:d;if(!this._events[v])return!1;var y,E,b=this._events[v],C=arguments.length;if(b.fn){switch(b.once&&this.removeListener(d,b.fn,void 0,!0),C){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,h),!0;case 3:return b.fn.call(b.context,h,u),!0;case 4:return b.fn.call(b.context,h,u,f),!0;case 5:return b.fn.call(b.context,h,u,f,p),!0;case 6:return b.fn.call(b.context,h,u,f,p,m),!0}for(E=1,y=new Array(C-1);E<C;E++)y[E-1]=arguments[E];b.fn.apply(b.context,y)}else{var L,I=b.length;for(E=0;E<I;E++)switch(b[E].once&&this.removeListener(d,b[E].fn,void 0,!0),C){case 1:b[E].fn.call(b[E].context);break;case 2:b[E].fn.call(b[E].context,h);break;case 3:b[E].fn.call(b[E].context,h,u);break;case 4:b[E].fn.call(b[E].context,h,u,f);break;default:if(!y)for(L=1,y=new Array(C-1);L<C;L++)y[L-1]=arguments[L];b[E].fn.apply(b[E].context,y)}}return!0},l.prototype.on=function(d,h,u){return a(this,d,h,u,!1)},l.prototype.once=function(d,h,u){return a(this,d,h,u,!0)},l.prototype.removeListener=function(d,h,u,f){var p=t?t+d:d;if(!this._events[p])return this;if(!h)return o(this,p),this;var m=this._events[p];if(m.fn)m.fn!==h||f&&!m.once||u&&m.context!==u||o(this,p);else{for(var v=0,y=[],E=m.length;v<E;v++)(m[v].fn!==h||f&&!m[v].once||u&&m[v].context!==u)&&y.push(m[v]);y.length?this._events[p]=y.length===1?y[0]:y:o(this,p)}return this},l.prototype.removeAllListeners=function(d){var h;return d?(h=t?t+d:d,this._events[h]&&o(this,h)):(this._events=new e,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,s.exports=l})(go);var jr=_t(go.exports);function sa(s,n){if(!((t=n.remuxResult).audio||t.video||t.text||t.id3||t.initSegment))return!1;var t,e=[],i=n.remuxResult,a=i.audio,o=i.video;return a&&fo(e,a),o&&fo(e,o),s.postMessage({event:"transmuxComplete",data:n},e),!0}function fo(s,n){n.data1&&s.push(n.data1.buffer),n.data2&&s.push(n.data2.buffer)}function po(s,n,t){n.reduce(function(e,i){return sa(s,i)||e},!1)||s.postMessage({event:"transmuxComplete",data:n[0]}),s.postMessage({event:"flush",data:t})}A!==void 0&&A&&(function(s){var n=new jr,t=function(i,a){s.postMessage({event:i,data:a})};n.on(w.FRAG_DECRYPTED,t),n.on(w.ERROR,t);var e=function(){var i=function(o){var l=function(d){t("workerLog",{logType:o,message:d})};T[o]=l};for(var a in T)i(a)};s.addEventListener("message",function(i){var a=i.data;switch(a.cmd){case"init":var o=JSON.parse(a.config);s.transmuxer=new na(n,a.typeSupported,o,a.vendor,a.id),xr(o.debug,a.id),e(),t("init",null);break;case"configure":s.transmuxer.configure(a.config);break;case"demux":var l=s.transmuxer.push(a.data,a.decryptdata,a.chunkMeta,a.state);De(l)?(s.transmuxer.async=!0,l.then(function(u){sa(s,u)}).catch(function(u){t(w.ERROR,{type:J.MEDIA_ERROR,details:F.FRAG_PARSING_ERROR,chunkMeta:a.chunkMeta,fatal:!1,error:u,err:u,reason:"transmuxer-worker push error"})})):(s.transmuxer.async=!1,sa(s,l));break;case"flush":var d=a.chunkMeta,h=s.transmuxer.flush(d);De(h)||s.transmuxer.async?(De(h)||(h=Promise.resolve(h)),h.then(function(u){po(s,u,d)}).catch(function(u){t(w.ERROR,{type:J.MEDIA_ERROR,details:F.FRAG_PARSING_ERROR,chunkMeta:a.chunkMeta,fatal:!1,error:u,err:u,reason:"transmuxer-worker flush error"})})):po(s,h,d)}})})(self);var la=Nr()||{isTypeSupported:function(){return!1}},Ao=(function(){function s(t,e,i,a){var o=this;this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;var l=t.config;this.hls=t,this.id=e,this.useWorker=!!l.enableWorker,this.onTransmuxComplete=i,this.onFlush=a;var d=function(E,b){(b=b||{}).frag=o.frag,b.id=o.id,E===w.ERROR&&(o.error=b.error),o.hls.trigger(E,b)};this.observer=new jr,this.observer.on(w.FRAG_DECRYPTED,d),this.observer.on(w.ERROR,d);var h,u,f,p,m={mp4:la.isTypeSupported("video/mp4"),mpeg:la.isTypeSupported("audio/mpeg"),mp3:la.isTypeSupported('audio/mp4; codecs="mp3"')},v=navigator.vendor;if(!this.useWorker||typeof Worker>"u"||(l.workerPath,0))this.transmuxer=new na(this.observer,m,l,v,e);else try{l.workerPath?(T.log("loading Web Worker "+l.workerPath+' for "'+e+'"'),this.workerContext=(f=l.workerPath,p=new self.URL(f,self.location.href).href,{worker:new self.Worker(p),scriptURL:p})):(T.log('injecting Web Worker for "'+e+'"'),this.workerContext=(h=new self.Blob(["var exports={};var module={exports:exports};function define(f){f()};define.amd=true;("+g.toString()+")(true);"],{type:"text/javascript"}),u=self.URL.createObjectURL(h),{worker:new self.Worker(u),objectURL:u})),this.onwmsg=function(E){return o.onWorkerMessage(E)};var y=this.workerContext.worker;y.addEventListener("message",this.onwmsg),y.onerror=function(E){var b=new Error(E.message+" ("+E.filename+":"+E.lineno+")");l.enableWorker=!1,T.warn('Error in "'+e+'" Web Worker, fallback to inline'),o.hls.trigger(w.ERROR,{type:J.OTHER_ERROR,details:F.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:b})},y.postMessage({cmd:"init",typeSupported:m,vendor:v,id:e,config:JSON.stringify(l)})}catch(E){T.warn('Error setting up "'+e+'" Web Worker, fallback to inline',E),this.resetWorker(),this.error=null,this.transmuxer=new na(this.observer,m,l,v,e)}}var n=s.prototype;return n.resetWorker=function(){if(this.workerContext){var t=this.workerContext,e=t.worker,i=t.objectURL;i&&self.URL.revokeObjectURL(i),e.removeEventListener("message",this.onwmsg),e.onerror=null,e.terminate(),this.workerContext=null}},n.destroy=function(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{var t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}var e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null},n.push=function(t,e,i,a,o,l,d,h,u,f){var p,m,v=this;u.transmuxing.start=self.performance.now();var y=this.transmuxer,E=l?l.start:o.start,b=o.decryptdata,C=this.frag,L=!(C&&o.cc===C.cc),I=!(C&&u.level===C.level),S=C?u.sn-C.sn:-1,R=this.part?u.part-this.part.index:-1,M=S===0&&u.id>1&&u.id===C?.stats.chunkCount,Q=!I&&(S===1||S===0&&(R===1||M&&R<=0)),P=self.performance.now();(I||S||o.stats.parsing.start===0)&&(o.stats.parsing.start=P),!l||!R&&Q||(l.stats.parsing.start=P);var U=!(C&&((p=o.initSegment)==null?void 0:p.url)===((m=C.initSegment)==null?void 0:m.url)),K=new Mc(L,Q,h,I,E,U);if(!Q||L||U){T.log("[transmuxer-interface, "+o.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+`
|
|
243
243
|
discontinuity: `+L+`
|
|
244
244
|
trackSwitch: `+I+`
|