(self.webpackChunkdouyin_web=self.webpackChunkdouyin_web||[]).push([["42422"],{793571:function(e,t,u){"use strict";var n=u(101199),r=u(280647);function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var u=Object.prototype.toString.call(e).slice(8,-1);if("Object"===u&&e.constructor&&(u=e.constructor.name),"Map"===u||"Set"===u)return Array.from(e);if("Arguments"===u||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return o(e,t)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var u=0,n=Array(t);u1&&void 0!==arguments[1]?arguments[1]:1e3,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=o.immediately,s=void 0!==l&&l,a=o.trailing,c=void 0===a||a,f=o.leading,h=void 0!==f&&f,D=(0,n.useRef)(),d=(0,n.useRef)(!1),p=(0,n.useRef)(!1),C=(0,n.useRef)(e);C.current=e;var m=(0,n.useRef)([]),E=(0,n.useCallback)(function(){D.current&&clearTimeout(D.current)},[]),v=(0,n.useCallback)(function(){for(var e,u=arguments.length,n=Array(u),r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if(this.config.showIcon)this.initIcons(),u.checkStyle&&this.show("",!1);else{u.checkStyle&&this.hide();return}null!==(e=this.player)&&void 0!==e&&e.isComplete?this._checkIcon():this.once(n.ly,function(){return t._checkIcon()}),this.config.docPiPTargetWindow&&this.isDocPIPAvailable()&&this.requestPIP(),this.isPip&&this.setAttr("data-state","pip")}},{key:"_checkIcon",value:function(){this.config.showIcon&&(r.ZP.removeClass(this.find(".xgplayer-icon"),"xg-icon-disable"),this.bind("click",this.switchPIP))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:'',class:"xg-get-pip"},pipIconExit:{icon:'',class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;if(!this._isInitIcons)this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit),this._isInitIcons=!0}},{key:"_initPipEvents",value:function(){var e=this,t=this.player;this.onBeforeFullscreenRequest=function(u){l.T.contains(t.root)&&l.T.detachEl(),e.exitPIP()},this.leavePIPCallback=function(){var u=t.paused;r.ZP.setTimeout(e,function(){u||t.videoPlay()},0),u||t.videoPlay(),e.setAttr("data-state","normal"),e.pipWindow=null,t.emit(n.W5,!1)},this.enterPIPCallback=function(u){e.setAttr("data-state","pip"),null!=u&&u.pictureInPictureWindow&&(e.pipWindow=u.pictureInPictureWindow),t.emit(n.W5,!0)},this.onWebkitpresentationmodechanged=function(u){var n=t.video.webkitPresentationMode;e.pMode===p.FULLSCREEN&&n!==p.FULLSCREEN&&t.onFullscreenChange(null,!1),e.pMode=n,n===p.PIP?e.enterPIPCallback(u):n===p.INLINE&&e.leavePIPCallback(u)},t.on(n.ml,this.onBeforeFullscreenRequest),t.video&&(t.video.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.video.addEventListener("leavepictureinpicture",this.leavePIPCallback),v.checkWebkitSetPresentationMode(t.video)&&t.video.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"requestPIP",value:function(e){var t=this.player,u=this.playerConfig,n=this.config;if(!!this.isPIPAvailable()&&!this.isPip)try{var i=u.poster;return i&&(t.video.poster="String"===r.ZP.typeOf(i)?i:i.poster),n.preferDocument&&this.isDocPIPAvailable()?l.T.requestWindow({config:n,window:e,player:t,onEnter:this.enterPIPCallback,onLeave:this.leavePIPCallback}):v.checkWebkitSetPresentationMode(t.video)?t.video.webkitSetPresentationMode("picture-in-picture"):t.video.requestPictureInPicture(),!0}catch(e){return!1}}},{key:"exitPIP",value:function(){var e=this.player;try{return this.isPIPAvailable()&&this.isPip&&(this.isDocPIPAvailable()&&this.getDocumentWindow()?l.T.exit():v.checkWebkitSetPresentationMode(e.video)?e.video.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(e){return!1}}},{key:"isPip",get:function(){var e=this.player;return!!(this.isDocPIPAvailable()&&this.getDocumentWindow())||document.pictureInPictureElement&&document.pictureInPictureElement===e.video||e.video.webkitPresentationMode===p.PIP}},{key:"isPIPAvailable",value:function(){var e=this.player.video;return("Boolean"!==r.ZP.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===r.ZP.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===r.ZP.typeOf(e.webkitSetPresentationMode))||this.isDocPIPAvailable()}},{key:"isDocPIPAvailable",value:function(){return l.T.isSupported()}},{key:"getWindow",value:function(){return this.pipWindow}},{key:"getDocumentWindow",value:function(){return l.T.window}},{key:"attachDocumentWindow",value:function(e){var t,u=this.config.docPiPNode||(null===(t=this.player)||void 0===t?void 0:t.root);l.T.attachPlayer(this.player,{element:u,window:e,onEnter:this.enterPIPCallback,onLeave:this.leavePIPCallback})}},{key:"destroy",value:function(){c(D(v.prototype),"destroy",this).call(this);var e=this.player,t=!(this.isPip&&this.getDocumentWindow()&&l.T.isStandaloneWindow);this.unbind("click",this.btnClick),e.off(n.ml,this.onBeforeFullscreenRequest),e.video.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.video.removeEventListener("leavepictureinpicture",this.leavePIPCallback),v.checkWebkitSetPresentationMode(e.video)&&e.video.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.isPip&&this.getDocumentWindow()&&l.T.detachPlayer(e),t&&this.exitPIP(),this.pipWindow=null,!l.T.isStandaloneWindow&&(l.T.window=null)}},{key:"render",value:function(){if(!!this.canShow())return'\n
\n
\n
').concat(this.i18n.PIP,"
\n
")}}],m=[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:i.kd.CONTROLS_RIGHT,index:6,showIcon:!1,preferDocument:!1,width:void 0,height:void 0,docPiPTargetWindow:void 0,docPiPNode:void 0,docPiPStyle:void 0,alwaysKeepDocumentWindow:!1}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}],C&&a(o.prototype,C),m&&a(o,m),Object.defineProperty(o,"prototype",{writable:!1}),v}(o.Z);t.Z=C},390923:function(e,t,u){"use strict";u.d(t,{Z:function(){return A}});var n=u("730084"),r=u("320401"),i=u("678305"),o=u("697233");function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},u=this.progressList,n=this.fragments;if(!(u.length<1)){var r=t.newIndex,i=t.curIndex,o=t.millisecond;r!==i&&u.map(function(t,u){ur&&(t[e].style.width=0)});var l=n[r],s=0===o?0:(o-l.start)/l.duration;u[r][e].style.width=s<0?0:"".concat(100*s,"%")}}},{key:"updateFocus",value:function(e){if(!!this.fragConfig.fragAutoFocus&&!(this.fragments.length<2)){if(!e){if(this.focusIndex>-1){this.unHightLight(this.focusIndex);var t={index:-1,preIndex:this.focusIndex,fragment:null};this._callBack&&this._callBack(t),this.focusIndex=-1}return}var u=this.findIndex(1e3*e.currentTime,this.focusIndex);if(u>=0&&u!==this.focusIndex){this.focusIndex>-1&&this.unHightLight(this.focusIndex),this.setHightLight(u);var n={index:u,preIndex:this.focusIndex,fragment:this.fragments[this.focusIndex]};this.focusIndex=u,this._callBack&&this._callBack(n)}}}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(parseInt(1e3*t,10))}var u=this.playedIndex,r=this.cachedIndex;if("Undefined"!==n.ZP.typeOf(e.played)){var i=this.findIndex(1e3*e.played,u);if(i<0)return;this.updateProgress("played",{newIndex:i,curIndex:u,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=i}if("Undefined"!==n.ZP.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,r);if(o<0)return;this.updateProgress("cached",{newIndex:o,curIndex:r,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var u=this.fragments;if(!u||0===u.length)return -1;if(1===u.length)return 0;if(t>-1&&tu[t].start&&eu[u.length-1].start)return u.length-1;for(var n=0;nu[n].start&&e<=u[n].end){t=n;break}return t}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var e=this.root.children,t=0;t0;)this.root.removeChild(u[0])}this.render()}}},{key:"render",value:function(){var e=this,t=this.style.progressColor;if(!this.root&&(this.root=n.ZP.createDom("xg-inners","",{},"progress-list")),this.fragments){var u=this.fragConfig,r=u.fragClass,i=u.fragFocusClass;this.progressList=this.fragments.map(function(u){var o=n.ZP.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(u.percent):"flex: ".concat(u.percent)},"".concat(u.isFocus?i:""," xgplayer-progress-inner ").concat(r));return e.root.appendChild(o),a.forEach(function(t){o.appendChild(n.ZP.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))}),{cached:o.children[0],played:o.children[1]}})}return this.root}}],s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),r}();function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){var u=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),u.push.apply(u,n)}return u}function D(e){for(var t=1;t0)||void 0===arguments[0]||arguments[0];this.useable=e}},{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.progress&&(e.config.disable=!e.player.config.progress)}},{key:"_initInner",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(!t||0===t.length)&&(t=[{percent:1}]);var n=D(D({fragments:t},u),{},{actionCallback:function(t){e.emitUserAction("fragment_focus","fragment_focus",t)}});this.innerList?this.innerList.reset(n):(this.innerList=new c(n),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map(function(t){e[t]=e.innerList[t].bind(e.innerList)}))}},{key:"_updateInnerFocus",value:function(e){this.innerList&&this.innerList.updateFocus(e)}},{key:"afterCreate",value:function(){var e=this;if(!this.config.disable&&!this.playerConfig.isLive){this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer");var t=this.config,u=t.fragFocusClass,n=t.fragAutoFocus,o=t.fragClass;this._initInner(this.config.fragments,{fragFocusClass:u,fragAutoFocus:n,fragClass:o,style:this.playerConfig.commonStyle||{}}),"mobile"===r.Z.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(i.aH,function(){e.onMouseLeave()}),this.on(i.MH,function(){e.onTimeupdate()}),this.on(i.kL,function(){e.onTimeupdate(),e.onCacheUpdate()}),this.on(i.ad,function(){e.onCacheUpdate()}),this.on(i.Ku,function(){e.onCacheUpdate(!0),e.onTimeupdate(!0),e._state.now=0}),this.on(i.RG,function(){e.onReset()}),this.on(i.km,function(){e.onVideoResize()}),this.on(i.td,function(){e.config.resetBlur&&e._disableBlur&&(e.enableBlur(),e.blur())}),this.bindDomEvents(),this.initCustomStyle()}}},{key:"setConfig",value:function(e){var t=this,u=null;Object.keys(e).forEach(function(n){t.config[n]=e[n],"fragments"===n&&(u=e[n])}),u&&this._initInner(u,e)}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===f(e)&&Object.keys(e).map(function(u){t.style[u]=e[u]}))}},{key:"triggerCallbacks",value:function(e,t,u){this.__dragCallBacks.length>0&&this.__dragCallBacks.map(function(n){if(n&&n.handler&&n.type===e)try{n.handler(t,u)}catch(e){}})}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var u=this.__dragCallBacks,n=-1;u.map(function(u,r){u&&u.type===e&&u.handler===t&&(n=r)}),n>-1&&u.splice(n,1)}},{key:"unlock",value:function(){var e=this.player,t=this.pos;if(t.isEnter=!1,!e.isMini){if(this.unbind("mousemove",this.onMoveOnly),t.isDown){this.unbind("mouseleave",this.onMouseLeave);return}this.blur()}}},{key:"bindDomEvents",value:function(){var e=this.player,t=e.controls,u=e.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),("touch"===this.domEventType||"compatible"===this.domEventType)&&(this.root.addEventListener("touchstart",this.onMouseDown),t&&(t.root&&t.root.addEventListener("touchmove",n.ZP.stopPropagation),t.center&&t.center.addEventListener("touchend",n.ZP.stopPropagation))),("mouse"===this.domEventType||"compatible"===this.domEventType)&&(this.bind("mousedown",this.onMouseDown),"mobile"!==u.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),n.ZP.addClass(this.root,"active")}},{key:"blur",value:function(){if(!this._disableBlur)this.player.controls.recoverAutoHide(),n.ZP.removeClass(this.root,"active")}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,u){var n=this.config,r=this.player;if(n.isCloseClickSeek&&0===u)return;var i=e>=r.duration?r.duration-n.endedDiff:Number(e).toFixed(1);if(this.updatePercent(t),this.updateTime(e),1!==u||!!n.isDragingSeek&&"audio"!==r.videoConfig.mediaType)this._state.now=i,this._state.direc=i>r.currentTime?0:1,r.seek(i)}},{key:"computeTime",value:function(e,t){var u,n,r=this.player,i=this.root.getBoundingClientRect(),o=i.width,l=i.height,s=i.top,a=i.left;90===r.rotateDeg?(u=l,n=s):(u=o,n=a);var c=t-n,f=(c=c>u?u:c<0?0:c)/u,h=parseInt((f=f<0?0:f>1?1:f)*this.duration*1e3,10)/1e3;return{percent:f,currentTime:h,offset:c,width:u,left:n,e:e}}},{key:"updateTime",value:function(e){var t=this.player,u=this.duration;e>u?e=u:e<0&&(e=0);var n=t.plugins.time;n&&n.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.duration},this.duration);var u=this.player.plugins.miniprogress;u&&u.update({played:e*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(e){var t=this.player,u=this._state,r=this.duration;if((!t.isSeeking||!t.video.seeking)&&!this.isProgressMoving&&!!t.hasStart){if(u.now>-1){var i=parseInt(1e3*u.now,10)-parseInt(1e3*t.currentTime,10);if(0===u.direc&&i>300||1===u.direc&&i>-300){u.now=-1;return}u.now=-1}var o=this.timeOffset+t.currentTime;o=n.ZP.adjustTimeByDuration(o,r,e),this.innerList.update({played:o},r),this.progressBtn.style.left="".concat(o/r*100,"%");var l=this.player.plugins.miniprogress;l&&l.update({played:o},r)}}},{key:"onCacheUpdate",value:function(e){var t=this.player,u=this.duration;if(!!t){var r=t.bufferedPoint.end;r=n.ZP.adjustTimeByDuration(r,u,e),this.innerList.update({cached:r},u);var i=this.player.plugins.miniprogress;i&&i.update({cached:r},u)}}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var u=this.domEventType;("touch"===u||"compatible"===u)&&(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),t&&(t.root&&t.root.removeEventListener("touchmove",n.ZP.stopPropagation),t.center&&t.center.removeEventListener("touchend",n.ZP.stopPropagation))),("mouse"===u||"compatible"===u)&&(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!1))}},{key:"render",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){var e=this.player.controls?this.player.controls.config.mode:"";return'\n \n \n \n \n \n ')}}}],a=[{key:"pluginName",get:function(){return"progress"}},{key:"defaultConfig",get:function(){return{position:o.kd.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],fragFocusClass:g.POINT,fragClass:"",fragAutoFocus:!1,miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2,resetBlur:!1}}},{key:"FRAGMENT_FOCUS_CLASS",get:function(){return g}}],s&&d(l.prototype,s),a&&d(l,a),Object.defineProperty(l,"prototype",{writable:!1}),v}(o.ZP)},952379:function(e,t,u){"use strict";u(932651);var n=u(101199);function r(){return(r=Object.assign||function(e){for(var t=1;t=19968&&e<=40959||e>=13312&&e<=19903||e>=131072&&e<=173791||e>=173824&&e<=177983||e>=177984&&e<=178207||e>=178208&&e<=183983||e>=183984&&e<=191471||e>=196608&&e<=201551||e>=63744&&e<=64255||e>=194560&&e<=195103||e>=12288&&e<=12351||e>=12352&&e<=12447||e>=12448&&e<=12543||e>=44032&&e<=55215||e>=65280&&e<=65519)return!0}return!1}let p=new Set([",",".","!",":",";","?","、","。","・",")","〕","〉","》","」","』","】","〗","〙","〛","ー","々","〻","ゝ","ゞ","ヽ","ヾ"]),C=new Set(['"',"(","[","{","“","‘","\xab","‹","(","〔","〈","《","「","『","【","〖","〘","〚"]),m=new Set(["'","’"]),E=new Set([".",",","!","?",":",";","،","؛","؟","।","॥","၊","။","၌","၍","၏",")","]","}","%",'"',"”","’","\xbb","›","…"]),v=new Set([":",".","،","؛"]),g=new Set(["၏"]),A=new Set(["”","’","\xbb","›","」","』","】","》","〉","〕",")"]);function y(e){let t=!1;for(let u of e)if(!("\\"===u||f.test(u))){if(C.has(u)||E.has(u)||m.has(u)){t=!0;continue}return!1}return t}function F(e){for(let t=e.length-1;t>=0;t--){let u=e[t];if(A.has(u))return!0;if(!E.has(u))break}return!1}function L(e){return 1===e.length?e[0]:e.join("")}function w(e){return"space"===e||"preserved-space"===e||"zero-width-break"===e||"hard-break"===e}let B=/^[A-Za-z][A-Za-z0-9+.-]*:$/,b=new Set([":","-","/","\xd7",",",".","+","–","—"]),x=/^[A-Za-z0-9_]+[,:;]*$/,k=/[,:;]+$/;function P(e){for(let t of e)if(h.test(t))return!0;return!1}function O(e){if(0===e.length)return!1;for(let t of e)if(!(h.test(t)||b.has(t)))return!1;return!0}u("76375"),u("240148"),u("780582");let M=null,S=new Map,N=null,_=/(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9\uDEF0-\uDEF8])/,I=/(?:[\xA9\xAE\u203C\u2049\u20E3\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2605\u2607-\u2612\u2614-\u2685\u2690-\u2705\u2708-\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763-\u2767\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\uFE0F]|\uD83C[\uDC00-\uDCFF\uDD0D-\uDD0F\uDD2F\uDD6C-\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDAD-\uDDFF\uDE01-\uDE0F\uDE1A\uDE2F\uDE32-\uDE3A\uDE3C-\uDE3F\uDE49-\uDFFF]|\uD83D[\uDC00-\uDD3D\uDD46-\uDE4F\uDE80-\uDEFF\uDF74-\uDF7F\uDFD5-\uDFFF]|\uD83E[\uDC0C-\uDC0F\uDC48-\uDC4F\uDC5A-\uDC5F\uDC88-\uDC8F\uDCAE-\uDCFF\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDEFF]|\uD83F[\uDC00-\uDFFD])/,Z=null,H=new Map;function T(){if(null!==M)return M;if("undefined"!=typeof OffscreenCanvas)return M=new OffscreenCanvas(1,1).getContext("2d");if("undefined"!=typeof document)return M=document.createElement("canvas").getContext("2d");throw Error("Text measurement requires OffscreenCanvas or a DOM canvas context.")}function j(e,t){let u=t.get(e);return void 0===u&&(u={width:T().measureText(e).width,containsCJK:d(e)},t.set(e,u)),u}function R(){if(null!==N)return N;if("undefined"==typeof navigator)return N={lineFitEpsilon:.005,carryCJKAfterClosingQuote:!1,preferPrefixWidthsForBreakableRuns:!1,preferEarlySoftHyphenBreak:!1};let e=navigator.userAgent,t="Apple Computer, Inc."===navigator.vendor&&e.includes("Safari/")&&!e.includes("Chrome/")&&!e.includes("Chromium/")&&!e.includes("CriOS/")&&!e.includes("FxiOS/")&&!e.includes("EdgiOS/");return N={lineFitEpsilon:t?1/64:.005,carryCJKAfterClosingQuote:e.includes("Chrome/")||e.includes("Chromium/")||e.includes("CriOS/")||e.includes("Edg/"),preferPrefixWidthsForBreakableRuns:t,preferEarlySoftHyphenBreak:t}}function W(){return null===Z&&(Z=new Intl.Segmenter(void 0,{granularity:"grapheme"})),Z}function $(e,t,u){var n,r;if(0===u)return t.width;return t.width-(n=e,void 0===(r=t).emojiCount&&(r.emojiCount=function(e){let t=0;for(let n of W().segment(e)){var u;if(u=n.segment,_.test(u)||u.includes("️"))t++}return t}(n)),r.emojiCount*u)}let V=null;new WeakMap;function U(e,t,u){var c,h,A,b;return c=e,h=t,A=!0,b=u,function(e,t,u){var n;let o=(null===V&&(V=new Intl.Segmenter(void 0,{granularity:"grapheme"})),V),l=R();let{cache:s,emojiCorrection:a}=function(e,t){var u;let n;T().font=e;let r=(u=e,!(n=S.get(u))&&(n=new Map,S.set(u,n)),n),i=function(e){let t=e.match(/(\d+(?:\.\d+)?)\s*px/);return t?parseFloat(t[1]):16}(e),o=t?function(e,t){let u=H.get(e);if(void 0!==u)return u;let n=T();n.font=e;let r=n.measureText("\uD83D\uDE00").width;if(u=0,r>t+.5&&"undefined"!=typeof document&&null!==document.body){let t=document.createElement("span");t.style.font=e,t.style.display="inline-block",t.style.visibility="hidden",t.style.position="absolute",t.textContent="\uD83D\uDE00",document.body.appendChild(t);let n=t.getBoundingClientRect().width;document.body.removeChild(t),r-n>.5&&(u=r-n)}return H.set(e,u),u}(e,i):0;return{cache:r,fontSize:i,emojiCorrection:o}}(t,(n=e.normalized,I.test(n))),c=$("-",j("-",s),a),f=8*$(" ",j(" ",s),a);if(0===e.len)return u?{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableWidths:[],breakablePrefixWidths:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[],segments:[]}:{widths:[],lineEndFitAdvances:[],lineEndPaintAdvances:[],kinds:[],simpleLineWalkFastPath:!0,segLevels:null,breakableWidths:[],breakablePrefixWidths:[],discretionaryHyphenWidth:0,tabStopAdvance:0,chunks:[]};let h=[],D=[],m=[],v=[],g=e.chunks.length<=1,A=u?[]:null,y=[],L=[],w=u?[]:null,B=Array.from({length:e.len}),b=Array.from({length:e.len});function x(e,t,u,n,r,i,o,l){"text"!==r&&"space"!==r&&"zero-width-break"!==r&&(g=!1),h.push(t),D.push(u),m.push(n),v.push(r),null==A||A.push(i),y.push(o),L.push(l),null!==w&&w.push(e)}for(let t=0;t0){let t=j(e,s),u=$(e,t,a);x(e,u,u,u,"text",i+n,null,null)}b[t]=h.length;continue}let D=$(u,f,a),m="space"===r||"preserved-space"===r||"zero-width-break"===r?0:D,v="space"===r||"zero-width-break"===r?0:D;if(n&&u.length>1){let e=function(e,t,u,n){if(void 0!==t.graphemeWidths)return t.graphemeWidths;let r=[];for(let t of W().segment(e)){let e=j(t.segment,u);r.push($(t.segment,e,n))}return t.graphemeWidths=r.length>1?r:null,t.graphemeWidths}(u,f,s,a),t=l.preferPrefixWidthsForBreakableRuns?function(e,t,u,n){if(void 0!==t.graphemePrefixWidths)return t.graphemePrefixWidths;let r=[],i=W(),o="";for(let t of i.segment(e)){let e=j(o+=t.segment,u);r.push($(o,e,n))}return t.graphemePrefixWidths=r.length>1?r:null,t.graphemePrefixWidths}(u,f,s,a):null;x(u,D,m,v,r,i,e,t)}else x(u,D,m,v,r,i,null,null);b[t]=h.length}let k=function(e,t,u){let n=[];for(let l=0;l=0&&"ET"===u[n];n--)u[n]="EN";for(n=e+1;n0?u[e-1]:a,i=n2&&void 0!==arguments[2]?arguments[2]:"normal",i=function(e){let t=null!=e?e:"normal";return"pre-wrap"===t?{mode:t,preserveOrdinarySpaces:!0,preserveHardBreaks:!0}:{mode:t,preserveOrdinarySpaces:!1,preserveHardBreaks:!1}}(r);let c="pre-wrap"===i.mode?(u=e,/[\r\f]/.test(u)?u.replace(/\r\n/g,"\n").replace(/[\r\f]/g,"\n"):u.replace(/\r\n/g,"\n")):function(e){if(!s.test(e))return e;let t=e.replace(l," ");return 32===t.charCodeAt(0)&&(t=t.slice(1)),t.length>0&&32===t.charCodeAt(t.length-1)&&(t=t.slice(0,-1)),t}(e);if(0===c.length)return{normalized:c,chunks:[],len:0,texts:[],isWordLike:[],kinds:[],starts:[]};let h=function(e,t,u){let r=(null===a&&(a=new Intl.Segmenter(n,{granularity:"word"})),a),i=0,o=[],l=[],s=[],c=[];for(let n of r.segment(e)){var h,A,b;for(let e of function(e,t,u,n){let r=[],i=null,o=[],l=u,s=!1,a=0;for(let c of e){let e=function(e,t){if(t.preserveOrdinarySpaces||t.preserveHardBreaks){if(" "===e)return"preserved-space";if(" "===e)return"tab";if(t.preserveHardBreaks&&"\n"===e)return"hard-break"}return" "===e?"space":"\xa0"===e||" "===e||"⁠"===e||"\uFEFF"===e?"glue":"​"===e?"zero-width-break":"\xad"===e?"soft-hyphen":"text"}(c,n),f="text"===e&&t;if(null!==i&&e===i&&f===s){o.push(c),a+=c.length;continue}null!==i&&r.push({text:L(o),isWordLike:s,kind:i,start:l}),i=e,o=[c],l=u+a,s=f,a+=c.length}return null!==i&&r.push({text:L(o),isWordLike:s,kind:i,start:l}),r}(n.segment,null!==(h=n.isWordLike)&&void 0!==h&&h,n.index,u)){let u="text"===e.kind;if(t.carryCJKAfterClosingQuote&&u&&i>0&&"text"===s[i-1]&&d(e.text)&&d(o[i-1])&&F(o[i-1]))o[i-1]+=e.text,l[i-1]=l[i-1]||e.isWordLike;else if(u&&i>0&&"text"===s[i-1]&&function(e){for(let t of e)if(!p.has(t)&&!E.has(t))return!1;return e.length>0}(e.text)&&d(o[i-1]))o[i-1]+=e.text,l[i-1]=l[i-1]||e.isWordLike;else{;if(u&&i>0&&"text"===s[i-1]&&0!==(A=o[i-1]).length&&g.has(A[A.length-1]))o[i-1]+=e.text,l[i-1]=l[i-1]||e.isWordLike;else{;if(u&&i>0&&"text"===s[i-1]&&e.isWordLike&&D(e.text)&&D(b=o[i-1])&&0!==b.length&&v.has(b[b.length-1]))o[i-1]+=e.text,l[i-1]=!0;else u&&!e.isWordLike&&i>0&&"text"===s[i-1]&&1===e.text.length&&"-"!==e.text&&"—"!==e.text&&function(e,t){if(0===e.length)return!1;for(let u of e)if(u!==t)return!1;return!0}(o[i-1],e.text)?o[i-1]+=e.text:u&&!e.isWordLike&&i>0&&"text"===s[i-1]&&(function(e){if(y(e))return!0;let t=!1;for(let u of e){if(E.has(u)){t=!0;continue}if(!(t&&f.test(u)))return!1}return t}(e.text)||"-"===e.text&&l[i-1])?o[i-1]+=e.text:(o[i]=e.text,l[i]=e.isWordLike,s[i]=e.kind,c[i]=e.start,i++)}}}}for(let e=1;e=0;e--)if("text"===s[e]&&!l[e]&&function(e){if(y(e))return!0;for(let t of e)if(!C.has(t)&&!m.has(t)&&!f.test(t))return!1;return e.length>0}(o[e])){let t=e+1;for(;t0;){let e=t[u-1];if(f.test(e)||C.has(e)||m.has(e)){u--;continue}break}return u<=0||u===t.length?null:{head:t.slice(0,u).join(""),tail:t.slice(u).join("")}}(t[e]);null!==u&&(t[e]=u.head,t[e+1]=u.tail+t[e+1],r[e+1]=r[e]+u.head.length)}return{len:t.length,texts:t,isWordLike:u,kinds:n,starts:r}}(function(e){let t=[],u=[],n=[],r=[];for(let i=0;i1;for(let e=0;e=e.len||w(e.kinds[s]))continue;let a=[],c=e.starts[s],f=s;for(;f0&&(t.push(L(a)),u.push(!0),n.push("text"),r.push(c),o=f-1)}return{len:t.length,texts:t,isWordLike:u,kinds:n,starts:r}}(function(e){let t=e.texts.slice(),u=e.isWordLike.slice(),n=e.kinds.slice(),r=e.starts.slice();for(let r=0;r