import{b5 as I,b6 as Fs,b7 as Us,__tla as Ds}from"./index.3b792103.js";import{T as Sr,F as _r,l as Z,D as Ir,m as f,a as ne,r as b,v as Rt,_ as h,b as p,g as Bs,e as R,t as G,c as x,i as E,O as Ns,x as Rs,A as W,o as Tr,I as j,E as $,U as Se,f as re,d as M,L as Cr,M as Ws,C,S as Er,N as Wt,n as Vt,h as Vs,j as V,k as Ze,$ as Ht,p as Pr,q as Hs,s as zs,u as et,w as zt,y as kr,z as Or,B as Ks,G as xr,H as me,J as Kt,K as Ar,P as Gt,Q as Gs,R as Js,V as qs,W as Xs,X as $s,Y as Qs,Z as Ys,a0 as Zs}from"./index.es.31073e1e.js";let Lr,ea=Promise.all([(()=>{try{return Ds}catch{}})()]).then(async()=>{var Jt={exports:{}},_e=null;function y(){return _e===null&&(_e=Sr()||_r()&&/[#|&]access_token=/.test(location.hash)||sessionStorage.getItem("".concat(Z,":").concat(Ir))==="1",sessionStorage.setItem("".concat(Z,":").concat(Ir),_e?"1":"0")),!!_e}function jr(){_e=null}const Mr=Object.freeze(Object.defineProperty({__proto__:null,_cleanupCachedIsInClient:jr,isInClient:y},Symbol.toStringTag,{value:"Module"}));var qt={};function O(){return qt}function Xt(e){qt=e}function $t(e,t){if(!t)throw f(ne,"liffId is necessary for liff.init()");var n=(y()?sessionStorage:localStorage).getItem("".concat(Z,":").concat(t,":").concat(e));try{return n===null?null:JSON.parse(n)}catch{return null}}function B(e){return $t(e,O().liffId)}function H(e,t){var n=O().liffId;if(!n)throw f(ne,"liffId is necessary for liff.init()");(y()?sessionStorage:localStorage).setItem("".concat(Z,":").concat(n,":").concat(e),JSON.stringify(t))}function N(){return B(b.CONTEXT)}function je(e){H(b.CONTEXT,e)}function Fr(){return((N()||{}).d||{}).aId}function Ur(){return((N()||{}).d||{}).autoplay||!1}function Dr(){return(N()||{}).profilePlus}function Qt(){return Boolean(B(b.IS_SUBSEQUENT_LIFF_APP))}function Yt(e){H(b.IS_SUBSEQUENT_LIFF_APP,e)}function Zt(){return B(b.APP_DATA)}function Me(e){H(b.APP_DATA,e)}function en(){return B(b.MST_VERIFIER)}function tn(e){H(b.MST_VERIFIER,e)}function nn(){return B(b.MSIT)}function rn(e){H(b.MSIT,e)}function Ie(){return B(b.MST)}function on(e){H(b.MST,e)}function tt(){return B(b.MST_CHALLENGE)}function sn(e){H(b.MST_CHALLENGE,e)}function an(){return B(b.CLIENT_ID)}function nt(e){H(b.CLIENT_ID,e)}function cn(){return B(b.RAW_CONTEXT)}function ge(){return B(b.FEATURE_TOKEN)}function rt(e){H(b.FEATURE_TOKEN,e)}function it(){return B(b.ID_TOKEN)}function ot(e){H(b.ID_TOKEN,e)}function oe(){return B(b.ACCESS_TOKEN)}function Fe(e){H(b.ACCESS_TOKEN,e)}function st(e){var t=O().liffId;if(!t)throw f(ne,"liffId is necessary for liff.init()");(y()?sessionStorage:localStorage).removeItem("".concat(Z,":").concat(t,":").concat(e))}function at(){return B(b.LOGIN_TMP)}function un(e){H(b.LOGIN_TMP,e)}function ct(){st(b.LOGIN_TMP)}function ln(e){var t=O();Rt.set("".concat(Z,":").concat(b.EXPIRES,":").concat(t.liffId),e.getTime(),{expires:e.toUTCString(),path:"/",secure:null})}function fn(){var e=O();return Rt.get("".concat(Z,":").concat(b.EXPIRES,":").concat(e.liffId))}function dn(){var e=O();Rt.remove("".concat(Z,":").concat(b.EXPIRES,":").concat(e.liffId),{path:"/"})}function ut(){return B(b.DECODED_ID_TOKEN)}function lt(e){H(b.DECODED_ID_TOKEN,e)}function hn(){Object.keys(b).forEach(function(e){st(b[e])}),dn()}const Br=Object.freeze(Object.defineProperty({__proto__:null,clean:hn,get:B,getAId:Fr,getAccessToken:oe,getAppData:Zt,getByLiffId:$t,getClientId:an,getConfig:O,getContext:N,getDecodedIDToken:ut,getExpireTime:fn,getFeatureToken:ge,getIDToken:it,getIsSubsequentLiffApp:Qt,getIsVideoAutoPlay:Ur,getLoginTmp:at,getMSIT:nn,getMST:Ie,getMSTChallenge:tt,getMSTVerifier:en,getProfilePlus:Dr,getRawContext:cn,remove:st,removeExpireTime:dn,removeLoginTmp:ct,set:H,setAccessToken:Fe,setAppData:Me,setClientId:nt,setConfig:Xt,setContext:je,setDecodedIDToken:lt,setExpireTime:ln,setFeatureToken:rt,setIDToken:ot,setIsSubsequentLiffApp:Yt,setLoginTmp:un,setMSIT:rn,setMST:on,setMSTChallenge:sn,setMSTVerifier:tn},Symbol.toStringTag,{value:"Module"}));function ft(){return"2.21.4"}const Nr=Object.freeze(Object.defineProperty({__proto__:null,getVersion:ft},Symbol.toStringTag,{value:"Module"}));function J(){return!!oe()}const Rr=Object.freeze(Object.defineProperty({__proto__:null,isLoggedIn:J},Symbol.toStringTag,{value:"Module"}));function Wr(e){return h(this,void 0,void 0,function(){var t,n,r;return p(this,function(i){switch(i.label){case 0:if(!e.ok)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e.json()];case 2:return[2,i.sent()];case 3:return i.sent(),[2,e];case 4:return t=String(e.status),n=Bs.has(t)?t:R,[4,e.json().catch(function(){throw f(n,e.statusText)})];case 5:throw r=i.sent(),f(r.error||n,r.error_description||r.message)}})})}function pn(e){var t=function(n){if(n)return n;var r=oe();if(!r)throw f(G,"Need access_token for api call, Please login first");return{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer ".concat(r)}}(e&&e.headers);return x(x({},e),{headers:t})}function F(e,t){var n;try{n=pn(t)}catch(r){return Promise.reject(r)}return fetch(e,n).then(Wr)}function Vr(e,t){var n;try{n=pn(t)}catch(r){return Promise.reject(r)}return fetch(e,n)}function A(e){var t=e.subdomain,n=t===void 0?"api":t,r=e.pathname;return"https://".concat(n,".").concat("line.me","/").concat(r)}var Hr={token:A({pathname:"oauth2/v2.1/token"}),certs:A({pathname:"oauth2/v2.1/certs"}),"openid-configuration":A({subdomain:"access",pathname:".well-known/openid-configuration"}),authorize:A({subdomain:"access",pathname:"liff/v1/authorize"}),profile:A({pathname:"v2/profile"}),message:A({pathname:"message/v3/share"}),friendship:A({pathname:"friendship/v1/status"}),shareTargetPicker:A({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker"}),shareTargetPickerOtt:A({pathname:"liff/v2/apps"}),shareTargetPickerResult:A({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker/result"}),apps:A({pathname:"liff/v2/apps"}),subWindowGetMSIT:A({pathname:"liff/v2/sub/msit"}),subWindowGetMSTByMSIT:A({pathname:"liff/v2/sub/mst"}),subWindowSubscribe:A({subdomain:"liff",pathname:"liff/v2/sub/waitResult"}),subWindowPost:A({pathname:"liff/v2/sub/result"}),subWindowGetAppData:A({pathname:"liff/v2/sub/appData"}),subWindowGetOrigin:function(e){return A({pathname:"liff/v2/sub/".concat(e,"/origin")})},accessTokenVerify:A({pathname:"oauth2/v2.1/verify"}),unauthorizedPermissions:A({subdomain:"liff",pathname:"liff/v2/incrementalAgreement/unauthorizedPermissions"}),permanentLink:A({subdomain:"liff",pathname:"liff/v2/permanentLink"})};function P(e){return Hr[e]}function vn(e){return F("".concat(P("accessTokenVerify"),"?access_token=").concat(encodeURIComponent(e)),{headers:{"Content-Type":"application/json",Accept:"application/json"}})}function mn(){return F(P("profile"))}const zr=Object.freeze(Object.defineProperty({__proto__:null,getProfile:mn},Symbol.toStringTag,{value:"Module"}));function Kr(){return h(this,void 0,void 0,function(){var e,t;return p(this,function(n){switch(n.label){case 0:if(!J())return[3,6];n.label=1;case 1:return n.trys.push([1,5,,6]),(e=ut())&&e.sub?[2,e.sub]:[3,2];case 2:return[4,mn()];case 3:if((t=n.sent())&&t.userId)return[2,t.userId];n.label=4;case 4:return[3,6];case 5:return n.sent(),E.debug("can't retrieve Mid/Uid because of something wrong"),[3,6];case 6:return[2]}})})}function Gr(){return h(this,void 0,void 0,function(){var e;return p(this,function(t){switch(t.label){case 0:return[4,Kr()];case 1:return(e=t.sent())&&e.substring(0,1)==="u"?[2,e]:[2]}})})}var Jr=function(){function e(){this.utsExtra={isLiffSuccessful:!1,isLoggedIn:!1,id:"",version:""},this.injected=!1}return Object.defineProperty(e,"CUSTOMPLACEID_INIT",{get:function(){return"liff.init"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"CUSTOMTYPE",{get:function(){return"liffSdk"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LiffUtsLoginStatus",{get:function(){return{isLoggedIn:1,isLiffSuccessful:2}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return"analytics"},enumerable:!1,configurable:!0}),e.prototype.install=function(t){var n=t.liff,r=t.internalHooks;this.liffCore=n,r.init.beforeFinished(this.beforeInitFinished.bind(this)),r.init.beforeSuccess(this.beforeInitSuccess.bind(this)),r.init.error(this.initError.bind(this))},e.prototype.changeRatioToUTSFormat=function(t){if(t&&Number.isFinite(t))return Math.round(100*t)},e.prototype.setExtra=function(){var t,n=this.utsExtra,r=n.isLiffSuccessful,i=n.isLoggedIn,s=n.id,o=n.version,c=(i?e.LiffUtsLoginStatus.isLoggedIn:0)|(r?e.LiffUtsLoginStatus.isLiffSuccessful:0);(t=this.uts)===null||t===void 0||t.setExtra("liff",{id:s,loginStatus:c,version:o})},e.prototype.assignUtsExtra=function(t){Object.assign(this.utsExtra,t)},e.prototype.setVersion=function(t){this.assignUtsExtra({version:t}),E.debug("[LIFFUTS][SDK version] ".concat(t)),this.setExtra()},e.prototype.setLiffId=function(t){this.assignUtsExtra({id:t}),E.debug("[LIFFUTS][LIFFID] ".concat(t)),this.setExtra()},e.prototype.setIsLoggedIn=function(t){this.assignUtsExtra({isLoggedIn:t}),E.debug("[LIFFUTS][isLoggedIn] ".concat(t)),this.setExtra()},e.prototype.sendLiffInit=function(){var t;E.debug("[LIFFUTS][sendCustom] liff.init"),(t=this.uts)===null||t===void 0||t.sendCustom({type:e.CUSTOMTYPE,params:{placeId:e.CUSTOMPLACEID_INIT}})},e.prototype.setIsLiffSuccessful=function(t){this.assignUtsExtra({isLiffSuccessful:t}),E.debug("[LIFFUTS][isLiffInitSuccessful] ".concat(t)),this.setExtra()},e.prototype.prepareReferrer=function(t){var n={};Object.keys(t).forEach(function(r){if(Ns.includes(r)){var i=t[r];typeof i=="string"&&i&&(n[r.replace(/^liff\.ref\./,"")]=i)}}),Object.keys(n).length>0&&(this.referrer=n)},e.prototype.beforeInitFinished=function(){return h(this,void 0,void 0,function(){var t,n,r,i,s,o,c,a,u,l,d,m;return p(this,function(v){switch(v.label){case 0:if(t=W.parse(window.location.search),this.prepareReferrer(t),n=N(),!(r=n==null?void 0:n.utsTracking))return[2];if(i=O(),s=i.liffId,o=i.analytics,r.mode!=="auto"||!o)return[3,6];E.debug("[LIFFUTS] ".concat(new Date().toUTCString())),v.label=1;case 1:return v.trys.push([1,3,,4]),c=this,[4,new Promise(function(g,S){var _=window.uts,w=document.createElement("script");w.type="text/javascript",w.src="https://static.line-scdn.net/uts/edge/4.1.0/uts.js",w.onload=function(){var T=window.uts;g(T),window.uts=_},w.onerror=function(T){S(T)},document.getElementsByTagName("head")[0].appendChild(w)})];case 2:return c.uts=v.sent(),[3,4];case 3:return a=v.sent(),E.debug("[LIFFUTS] cannot load UTS, reason: ".concat(a)),[2];case 4:return u=x(x({},o.context),{utsId:o.context.utsId,appName:o.context.appName,appEnv:o.context.appEnv||"release"}),l=x(x({endpoint:"https://uts-front.line-apps.com"},o.options),{sampleRate:this.changeRatioToUTSFormat(r.sendRatio),version:"current"}),this.uts.init(u,l),[4,Gr()];case 5:(d=v.sent())&&(E.debug("[LIFFUTS][mid] ".concat(d)),this.uts.setMid(d)),n!=null&&n.tid&&(E.debug("[LIFFUTS][tid] ".concat(n.tid)),this.uts.setTid(n.tid)),this.referrer&&(E.debug("liff.ref.referrer",this.referrer),this.uts.setSessionParams(this.referrer)),s&&this.setLiffId(s),this.setIsLoggedIn(J()),this.setVersion(ft()),m=Rs(location.href),E.debug("[LIFFUTS][url] ".concat(m)),this.uts.setUrl(m),this.liffCore.analytics=this.uts,this.injected=!0,v.label=6;case 6:return[2]}})})},e.prototype.beforeInitSuccess=function(){return this.injected&&(this.setIsLiffSuccessful(!0),this.sendLiffInit()),Promise.resolve()},e.prototype.initError=function(){return this.injected&&(this.setIsLiffSuccessful(!1),this.sendLiffInit()),Promise.resolve()},e}(),gn=function(e){E.debug("[LIFFUTS][sendCustom] liff.shareTargetPicker"),e.sendCustom({type:"liffSdk",params:{placeId:"liff.shareTargetPicker"}})};const qr=Object.freeze(Object.defineProperty({__proto__:null,AnalyticsModule:Jr,sendShareTargetPicker:gn},Symbol.toStringTag,{value:"Module"})),Xr=I(qr);var Ue;function Q(){if(!Ue){var e=window.navigator.userAgent.toLowerCase();Ue=/iphone|ipad|ipod/.test(e)?"ios":/android/.test(e)?"android":"web"}return Ue}function $r(){Ue=void 0}const Qr=Object.freeze(Object.defineProperty({__proto__:null,_cleanupCachedOS:$r,getOS:Q},Symbol.toStringTag,{value:"Module"}));function ie(){var e=navigator.userAgent.match(/Line\/\d+(\.\d+)*/i);return e?e[0].slice(5):null}const Yr=Object.freeze(Object.defineProperty({__proto__:null,getLineVersion:ie},Symbol.toStringTag,{value:"Module"}));function wn(e){return new CustomEvent(Tr,{detail:e})}(function(){if(typeof window.CustomEvent!="function"){let e=function(t,n){var r=n||{},i=r.bubbles,s=i!==void 0&&i,o=r.cancelable,c=o!==void 0&&o,a=r.detail,u=a===void 0?void 0:a,l=document.createEvent("CustomEvent");return l.initCustomEvent(t,s,c,u),l};e.prototype=Event.prototype,window.CustomEvent=e}})();var we={},bn=!1;function dt(e,t){bn||(bn=!0,window.addEventListener(Tr,function(n){n&&n.detail&&n.detail.type&&we[n.detail.type]&&we[n.detail.type].forEach(function(r){return r(n)})})),we[e]?we[e].push(t):we[e]=[t]}function ht(e,t){var n=we[e];if(n&&Array.isArray(n)){var r=n.indexOf(t);r>=0&&n.splice(r,1)}}function Zr(e){var t={};try{t=JSON.parse(e)}catch(r){throw f(j,r.message)}var n=wn(t);E.debug("[client dispatchEvent to js]",{type:n.type,detail:n.detail}),window.dispatchEvent(n)}function yn(e,t,n){t===void 0&&(t={}),n===void 0&&(n="");var r=ge();if(!r)throw f($,"Invalid featureToken for client features");if(!window._liff||!window._liff.postMessage)throw f(j,"postMessage is not available from client");E.debug("[js postMessage to client]",e,n,t),window._liff.postMessage(e,r,n,JSON.stringify(t))}function pt(e,t,n){return t===void 0&&(t={}),n===void 0&&(n={once:!0}),ge()?(n=x({callbackId:Se(12),once:!0},n),new Promise(function(r,i){var s=function(o){if(o&&o.detail){var c=o.detail.callbackId===n.callbackId,a=typeof o.detail.callbackId!="string";(c||a)&&(n.once&&ht(e,s),E.debug("[callback detail]",o.detail),o.detail.error?i(o.detail.error):o.detail.data?r(o.detail.data):i(o.detail))}i()};dt(e,s),yn(e,t,n.callbackId)})):Promise.reject(f($,"Invalid featureToken for client features"))}const ei=Object.freeze(Object.defineProperty({__proto__:null,addListener:dt,call:pt,createEvent:wn,dispatch:Zr,postMessage:yn,removeListener:ht},Symbol.toStringTag,{value:"Module"}));function Te(){var e=ie();e!==null&&(Q()==="ios"&&re(e,"9.19")>=0||Q()==="android"&&re(e,"11.6.0")>=0)?location.href="liff://close":window._liff&&window._liff.postMessage?e!==null&&re(e,"10.15.0")>=0?Q()==="ios"?window._liff.postMessage("closeWindow",""):window._liff.postMessage("closeWindow","","",""):pt("closeWindow"):window.close()}const ti=Object.freeze(Object.defineProperty({__proto__:null,closeWindow:Te},Symbol.toStringTag,{value:"Module"})),ni=I(ti);function ri(){return F(P("friendship"))}const ii=Object.freeze(Object.defineProperty({__proto__:null,getFriendship:ri},Symbol.toStringTag,{value:"Module"})),oi=I(ii);function si(){return navigator.language}const ai=Object.freeze(Object.defineProperty({__proto__:null,getLanguage:si},Symbol.toStringTag,{value:"Module"})),ci=I(ai),ui=I(Yr),li=I(Qr),fi=I(zr),di=I(Nr);var De=navigator.language,vt=null;function hi(e){return h(this,void 0,void 0,function(){return p(this,function(t){switch(t.label){case 0:return De=e,[4,Sn()];case 1:return t.sent(),[2]}})})}function Sn(){return h(this,void 0,void 0,function(){var e,t;return p(this,function(n){switch(n.label){case 0:return[4,F("".concat("https://liffsdk.line-scdn.net/xlt/manifest.json"),{method:"GET",headers:{Accept:"application/json"}})];case 1:return e=n.sent(),t="".concat(De),!e.languages[t]&&De.includes("-")&&(t=De.split("-")[0]),e.languages[t]||(t="en"),[4,F("".concat("https://liffsdk.line-scdn.net/xlt","/").concat(e.languages[t]),{method:"GET",headers:{Accept:"application/json"}})];case 2:return vt=n.sent(),[2]}})})}function Be(e){if(vt===null)throw f(M,"please call xlt after liff.init");return vt[e]}var pi=new(function(){function e(){this.name="i18n"}return e.prototype.install=function(t){return t.internalHooks.init.beforeFinished(this.beforeInitFinished.bind(this)),{setLang:hi}},e.prototype.beforeInitFinished=function(){return h(this,void 0,void 0,function(){return p(this,function(t){switch(t.label){case 0:return[4,Sn()];case 1:return t.sent(),[2]}})})},e}());const vi=Object.freeze(Object.defineProperty({__proto__:null,module:pi,t:Be},Symbol.toStringTag,{value:"Module"})),mi=I(vi);var mt,gi=new Promise(function(e){mt=e});const wi=Object.freeze(Object.defineProperty({__proto__:null,get done(){return mt},ready:gi},Symbol.toStringTag,{value:"Module"}));function bi(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(u){try{a(r.next(u))}catch(l){s(l)}}function c(u){try{a(r.throw(u))}catch(l){s(l)}}function a(u){var l;u.done?i(u.value):(l=u.value,l instanceof n?l:new n(function(d){d(l)})).then(o,c)}a((r=r.apply(e,t||[])).next())})}function yi(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(a){return function(u){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||l[0]!==6&&l[0]!==2)){o=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]0)&&re(n,e)>=0}function Ee(e){var t=Ce(e);if(!t)return!1;var n=t.permission,r=t.minVer,i=t.unsupportedFromVer;return!!n&&!!y()&>(r,i)}var ki={shareTargetPicker:function(){if(!J())return!1;var e=Ce("shareTargetPicker");if(!e)return!1;var t=e.permission,n=e.minVer;if(!t)return!1;if(y()){var r=ie();return r!==null&&re(r,n)>=0}return!0},multipleLiffTransition:function(){var e=Ce("multipleLiffTransition");if(!e)return!1;var t=e.permission;return y()&&t},subwindowOpen:function(){var e=Ce("subwindowOpen");return!(!e||!e.permission)&&(!y()||gt(e.minVer,e.unsupportedFromVer))},scanCode:function(){return Ee("scanCode")},scanCodeV2:function(){if(!J())return!1;var e=Ce("scanCodeV2");return!(!e||!e.permission)&&(!y()||gt(e.minVer))},getAdvertisingId:function(){return Ee("getAdvertisingId")},addToHomeScreen:function(){return Ee("addToHomeScreen")},bluetoothLeFunction:function(){return Ee("bluetoothLeFunction")},skipChannelVerificationScreen:function(){return Ee("skipChannelVerificationScreen")}};function fe(e){if(!Pi.includes(e))throw f(j,"Unexpected API name.");var t=ki[e];return!t||t()}const Oi=Object.freeze(Object.defineProperty({__proto__:null,isApiAvailable:fe},Symbol.toStringTag,{value:"Module"}));var Cn="liff.subwindow.identifier",wt="liff.subwindow.cryptokey",Ne=x(x({},C),{GET_DATA:"getData",SET_DATA:"setData",NOT_FOUND:"notFound",TEARDOWN:"teardown"}),Re={BROADCAST:"broadcast",COMMAND:"command"},Pe={MAIN:"main",SUB:"sub"},En=function(e){return h(void 0,void 0,void 0,function(){var t;return p(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,window.crypto.subtle.importKey("jwk",{kty:"oct",k:e,alg:"A128GCM",ext:!0},{name:"AES-GCM"},!1,["encrypt","decrypt"])];case 1:return[2,n.sent()];case 2:throw t=n.sent(),f(R,t);case 3:return[2]}})})},xi=function(e,t,n){return h(void 0,void 0,void 0,function(){var r,i,s,o;return p(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),r=new TextEncoder().encode(e),[4,En(t)];case 1:return i=c.sent(),[4,window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},i,new TextEncoder().encode(n))];case 2:return s=c.sent(),[2,btoa(new Uint8Array(s).reduce(function(a,u){return a+String.fromCharCode(u)},""))];case 3:throw o=c.sent(),f(R,o);case 4:return[2]}})})},Ai=function(e,t,n){return h(void 0,void 0,void 0,function(){var r,i,s,o,c,a,u;return p(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),r=new TextEncoder().encode(e),[4,En(t)];case 1:for(i=l.sent(),s=atob(n),o=new Uint8Array(s.length),c=0;c0&&i.length>0},this.isReady=function(){return t.hasIdentification()&&!!t.messageHandlerInstance},this.setup=function(){return h(t,void 0,void 0,function(){var n,r,i,s,o,c=this;return p(this,function(a){switch(a.label){case 0:return this.messageHandlerInstance?[2]:[4,this.generateIdentification()];case 1:if(a.sent(),!(n=this.identification.identifier))return[2];if(r=/^[a-zA-Z0-9]+$/gm,!n.match(r))throw f(R,"Invalid identifier");return(i=document.createElement("iframe")).style.display="none",i.src="about:blank",document.body.appendChild(i),(o=i==null?void 0:i.contentWindow)===null||o===void 0||o.window.eval("(".concat(Mi.toString().replace("$MESSAGE_HANDLER_URL","".concat("https://liff-subwindow.line.me/liff/v2/sub/messageHandler")).replace("$IDENTIFIER",n.split("'")[0]),")()")),s="iframe-".concat(n,"-ready"),[4,new Promise(function(u){var l=function(d){d.data[s]&&(c.messageHandlerInstance=i,window.addEventListener("message",c.proxyToListeners),u(),document.removeEventListener("message",l))};window.addEventListener("message",l)})];case 2:return[2,a.sent()]}})})},this.teardown=function(){return h(t,void 0,void 0,function(){var n,r;return p(this,function(i){switch(i.label){case 0:return this.isReady()?[4,this.send({eventName:Ne.TEARDOWN})]:[3,2];case 1:i.sent(),window.removeEventListener("message",this.proxyToListeners),this.listeners.clear(),(r=(n=this.messageHandlerInstance)===null||n===void 0?void 0:n.parentNode)===null||r===void 0||r.removeChild(this.messageHandlerInstance),this.messageHandlerInstance=null,i.label=2;case 2:return[2]}})})},this.listen=function(n){t.listeners.set(n,n)},this.listenRepliedEvent=function(n,r){var i=function(s){s.replyTarget&&Li(s.replyTarget,n)&&(r(s),t.listeners.delete(i))};t.listeners.set(i,i)},this.send=function(n){return h(t,void 0,void 0,function(){var r,i,s,o,c=this;return p(this,function(a){switch(a.label){case 0:if(!this.isReady())throw f("message bus is not ready to send message");return i={action:ji(n.eventName),identifier:this.identification.identifier||"",timestamp:new Date().getTime()},[4,this.getEncryptedContext(n)];case 1:return i.context=a.sent(),r=i,(o=(s=this.messageHandlerInstance)===null||s===void 0?void 0:s.contentWindow)===null||o===void 0||o.postMessage({messageBusEvent:r},"*"),this.sentMessages.push(ke(r)),[4,new Promise(function(u){c.listenRepliedEvent(r,function(l){u(l.context)})})];case 2:return[2,a.sent()]}})})},this.reply=function(n,r){return h(t,void 0,void 0,function(){var i,s,o,c;return p(this,function(a){switch(a.label){case 0:if(!this.isReady())throw f("message bus is not ready to send message");if(!n.identifier||!n.timestamp)throw f(R,"target message is not valid");return s={action:Re.BROADCAST},[4,this.getEncryptedContext(r)];case 1:return s.context=a.sent(),s.identifier=this.identification.identifier||"",s.timestamp=new Date().getTime(),s.replyTarget={action:n.action,identifier:n.identifier,timestamp:n.timestamp},i=s,(c=(o=this.messageHandlerInstance)===null||o===void 0?void 0:o.contentWindow)===null||c===void 0||c.postMessage({messageBusEvent:i},"*"),this.sentMessages.push(ke(i)),[2]}})})},this.setData=function(n,r){n===void 0&&(n="appData"),t.send({eventName:Ne.SET_DATA,key:n,data:r})},this.getData=function(n){return n===void 0&&(n="appData"),h(t,void 0,void 0,function(){return p(this,function(r){switch(r.label){case 0:return[4,this.send({eventName:Ne.GET_DATA,key:n})];case 1:return[2,r.sent()]}})})},this.proxyToListeners=function(n){return h(t,void 0,void 0,function(){var r,i=this;return p(this,function(s){return(r=n.data.messageBusEvent)?(this.sentMessages.includes(ke(r))||r.identifier!==this.identification.identifier||r.action!==Re.BROADCAST&&!r.replyTarget||this.listeners.forEach(function(o){return h(i,void 0,void 0,function(){var c,a,u;return p(this,function(l){switch(l.label){case 0:return c=o,a=[x({},r)],u={},[4,this.getDecryptedContext(r.context)];case 1:return c.apply(void 0,[x.apply(void 0,a.concat([(u.context=l.sent(),u)]))]),[2]}})})}),[2]):[2]})})},this.getEncryptedContext=function(n){return h(t,void 0,void 0,function(){var r,i,s,o,c,a,u;return p(this,function(l){switch(l.label){case 0:return r=this.identification,i=r.identifier,s=r.cryptoKey,c=(o=JSON).stringify,u={eventName:n.eventName,key:n.key?n.key:void 0},n.data?[4,xi(i,s,JSON.stringify(n.data))]:[3,2];case 1:return a=l.sent(),[3,3];case 2:a=void 0,l.label=3;case 3:return[2,c.apply(o,[(u.data=a,u)])]}})})},this.getDecryptedContext=function(n){return h(t,void 0,void 0,function(){var r,i,s,o,c,a,u,l;return p(this,function(d){switch(d.label){case 0:return r=this.identification,i=r.identifier,s=r.cryptoKey,(o=JSON.parse(n)).data&&typeof o.data=="string"?(l=(u=JSON).parse,[4,Ai(i,s,o.data)]):[3,2];case 1:return a=l.apply(u,[d.sent()]),[3,3];case 2:a=void 0,d.label=3;case 3:return c=a,[2,x(x({},o),{data:c})]}})})},this.windowType=e};function Pn(e){var t=P("subWindowGetOrigin");return F(t(e))}var se={};function be(e,t){e&&se[e]&&se[e].forEach(function(n){n(t)})}var kn,On,xn,An,bt,Ln=function(){function e(t){this.storage=t}return e.prototype.getItem=function(t){return this.storage.getItem("".concat(this.getKeyPrefix(),":").concat(t))},e.prototype.setItem=function(t,n){this.storage.setItem("".concat(this.getKeyPrefix(),":").concat(t),n)},e.prototype.removeItem=function(t){this.storage.removeItem("".concat(this.getKeyPrefix(),":").concat(t))},e.prototype.clear=function(){this.storage.clear()},e.prototype.getKeyPrefix=function(){return"".concat(Z,":").concat(this.getLiffId())},e.prototype.getLiffId=function(){var t=O().liffId;if(!t)throw f(ne,"liffId is necessary for liff.init()");return t},e}(),jn=new Ln(zs);function We(){var e=jn.getItem("subWindowStatusUpdated");return e!==null&&JSON.parse(e)}function de(e){jn.setItem("subWindowStatusUpdated",String(e))}function yt(e){kn=e}function Oe(){return kn}function St(){return xn}function Mn(){return An}function _t(e){return e===void 0&&(e=Pe.MAIN),h(this,void 0,void 0,function(){return p(this,function(t){switch(t.label){case 0:return[4,(bt=new Fi(e)).setup()];case 1:return t.sent(),[2,bt]}})})}function he(){return bt}var Fn=new Ln(window.sessionStorage);function Un(e){Fn.setItem("mainWindowOrigin",e)}function It(){return Fn.getItem("mainWindowOrigin")}function Dn(e,t){return t===void 0&&(t={}),h(this,void 0,void 0,function(){var n,r,i,s,o,c,a,u;return p(this,function(l){switch(l.label){case 0:if((n=he())!=null&&n.isReady())return[3,5];if(r=JSON.stringify(t),i=O().liffId,s=It(),!window.opener||!s||!i)throw f(Wt);o=!1,l.label=1;case 1:return l.trys.push([1,3,,4]),[4,Pn(i)];case 2:return c=l.sent(),o=c.subwindowCommonModule,[3,4];case 3:throw a=l.sent(),E.debug(a),f(Wt);case 4:return u=o?s:location.origin,[2,new Promise(function(d){window.addEventListener("message",function m(v){(function(g){return!!(g.data&&typeof g.data.type=="string"&&[C.SUBMIT,C.CANCEL].includes(g.data.type))})(v)&&(window.removeEventListener("message",m),d({status:e,result:r}))}),window.opener.postMessage({status:e,result:r},u)})];case 5:return n.send({eventName:e,data:t}),[4,new Promise(function(d){setTimeout(d,500)})];case 6:return l.sent(),[2,{status:e,result:JSON.stringify(t)}]}})})}function Tt(e){var t,n=Mn();if(e.origin===n){var r=e.data;if(r){var i,s=r.status,o=r.result;try{i=JSON.parse(o||"{}")}catch{i={}}switch(s){case et:window.clearInterval(St()),Ct();break;case C.CANCEL:case C.SUBMIT:de(!0),window.clearInterval(St()),window.removeEventListener("message",Tt),be(s,i),(t=Oe())===null||t===void 0||t.postMessage({type:s},Mn());break;default:E.debug("unexpected message")}}}}var Ui=function(e){return h(void 0,void 0,void 0,function(){var t,n,r,i;return p(this,function(s){if(We())return[2];switch(t=e.context,n=t.eventName,r=t.data,i=he(),n){case C.INIT:Nn(!r.hasOpener);break;case C.CANCEL:case C.SUBMIT:de(!0),be(n,r),i==null||i.reply(e,{eventName:n});break;case C.CLOSE:We()===!1&&(de(!0),be(C.CLOSE,{})),Ct()}return[2]})})};function Bn(){window.clearInterval(On),window.clearInterval(St()),window.removeEventListener("message",Tt)}function Nn(e){if(e===void 0&&(e=!1),Bn(),de(!1),e){var t=Oe();t&&(t.close(),yt(null))}}function Ct(){return h(this,void 0,void 0,function(){var e;return p(this,function(t){switch(t.label){case 0:return(e=he())?[4,e.teardown()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}function Di(e){return h(this,void 0,void 0,function(){var t,n,r,i,s,o,c,a,u,l;return p(this,function(d){switch(d.label){case 0:return(t=Pr(e.url))?(Nn(!0),[4,Ct()]):[2,Promise.reject(f(j,"params.url must be liff url"))];case 1:return d.sent(),n=e.url,r=e.appData,(i=new URL(n)).searchParams.append(Cr,"true"),[4,_t()];case 2:return s=d.sent(),i.searchParams.append(Cn,s.identification.identifier),i.searchParams.append(wt,s.identification.cryptoKey),i.hostname=function(v){var g=V(v.split(".")),S=g[0],_=g.slice(1);return Ze(["".concat(S,"-ext")],V(_),!1).join(".")}(i.hostname),o=i.toString(),yt(Q()!=="ios"||Ht()?window.open("","liffsubwindow","width=480, height=640, menubar=no, toolbar=no, scrollbars=yes"):window.open()),[4,Pn(t)];case 3:if(c=d.sent(),a=c.origin,u=c.subwindowCommonModule,!(l=Oe()))throw f(Vt);return u?(function(v){An=v}(a),s.listen(Ui),s.setData("appData",r),window.addEventListener("message",Tt),l.location.href=o,m=function(v,g){var S=Oe(),_={type:et};return g&&(_.message=JSON.stringify(g)),window.setInterval(function(){S==null||S.postMessage(_,v)},Er)}(a,r),xn=m,function(v){On=v}(window.setInterval(function(){var v=Oe();v&&v.closed&&(Bn(),yt(null),We()===!1&&(de(!0),be(C.CLOSE,{})))},Vs)),[2]):(l.close(),[2])}var m})})}function Ve(e){return h(this,void 0,void 0,function(){var t,n,r,i,s,o,c,a,u,l,d;return p(this,function(m){switch(m.label){case 0:t=e.msit,n=e.mstChallenge,r=e.onSuccess,i=e.onError,s=e.reconnectCount,o=s===void 0?0:s,m.label=1;case 1:return m.trys.push([1,3,,6]),[4,Vr(P("subWindowSubscribe"),{method:"POST",body:JSON.stringify({msit:t,mstChallenge:n})})];case 2:return c=m.sent(),[3,6];case 3:return m.sent(),[4,Rn()];case 4:return m.sent(),[4,Et(Ve,{msit:t,mstChallenge:n,onSuccess:r,onError:i,reconnectCount:o+=1})];case 5:return m.sent(),[2];case 6:return c.status>=500?[4,Rn()]:[3,9];case 7:return m.sent(),[4,Et(Ve,{msit:t,mstChallenge:n,onSuccess:r,onError:i,reconnectCount:o+=1})];case 8:return m.sent(),[3,20];case 9:return c.status>=400&&500>c.status?[4,Wn(c)]:[3,11];case 10:return(u=m.sent())?(a=u.errorDetail,i(f(j,a))):i(f(R,"Some error happened in the server")),[3,20];case 11:return c.status!==200?[3,19]:[4,Wn(c)];case 12:return(u=m.sent())?[3,13]:(i(f(R,"Some error happened in the server")),[3,18]);case 13:switch(l=u.status,d=u.result,l){case C.ERROR:return[3,14];case C.CLOSE:case C.CANCEL:case C.SUBMIT:return[3,16]}return[3,17];case 14:return[4,Et(Ve,{msit:t,mstChallenge:n,onSuccess:r,onError:i,reconnectCount:o})];case 15:return m.sent(),[3,18];case 16:return r(l,d),[3,18];case 17:i(f(R,"Some error happened in the server")),m.label=18;case 18:return[3,20];case 19:i(f(R,"Some error happened in the server")),m.label=20;case 20:return[2]}})})}function Rn(){return new Promise(function(e){return setTimeout(e,1e3)})}function Wn(e){return h(this,void 0,void 0,function(){return p(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.json()];case 1:return[2,t.sent()];case 2:return t.sent(),[2,null];case 3:return[2]}})})}function Et(e,t){return h(this,void 0,void 0,function(){return p(this,function(n){switch(n.label){case 0:return t.reconnectCount>=10?(t.onError(f(R,"Failed to connect")),[3,3]):[3,1];case 1:return[4,e(t)];case 2:n.sent(),n.label=3;case 3:return[2]}})})}function Bi(e){var t={};return Object.keys(e).forEach(function(n){n==="closeButtonColor"?e[n]==="white"?t[n]="#ffffff":t[n]="#000000":t[n]=e[n]}),t}var Ni={height:"full",closeButtonPosition:"right",closeButtonColor:"black",closeButtonLabel:""};function Ri(e){var t=e.appData,n=e.native,r=O().liffId,i=tt(),s=Pr(e.url);if(!r)return Promise.reject(f(G,"liffId is invalid"));if(!i)return Promise.reject(f(G,"mst_challenge is invalid"));if(!s)return Promise.reject(f(j,"params.url must be liff url"));var o=Object.assign({},Ni,n);return function(c){var a=c.mainLiffId,u=c.subLiffId,l=c.mstChallenge,d=c.appData,m=c.view;return a&&l?F(P("subWindowGetMSIT"),{method:"POST",body:JSON.stringify({mainLiffId:a,subLiffId:u,mstChallenge:l,appData:d,view:m})}):Promise.reject(f(j,"no proper argument"))}({mainLiffId:r,subLiffId:s,mstChallenge:i,appData:t,view:Bi(o)}).then(function(c){var a=c.msit;Ve({msit:a,mstChallenge:i,onSuccess:function(u,l){be(u,l)},onError:function(u){be(C.ERROR,u)}}),function(u,l){var d=u.url,m=new URLSearchParams;m.set("msit",l),location.href="".concat(Hs,"?url=").concat(encodeURIComponent(d),"&").concat(m.toString())}(e,a)})}function He(){if(!le())throw f(G,"this api can be only called in child window")}function Pt(e){if(!e.mst||!e.status)return Promise.reject(f(j,"no proper argument"));var t=JSON.stringify(e);return F(P("subWindowPost"),{method:"POST",body:t})}function Vn(e){var t=e.msit,n=e.mstVerifier;return t&&n?F(P("subWindowGetMSTByMSIT"),{method:"POST",body:JSON.stringify({msit:t,mstVerifier:n})}):Promise.reject(f(j,"no proper argument"))}function Hn(e){var t=e.mst;return t?F(P("subWindowGetAppData"),{method:"POST",body:JSON.stringify({mst:t})}):Promise.reject(f(j,"no proper argument"))}var q={on:function(e,t){se[e]||(se[e]=[]),se[e].push(t)},off:function(e,t){if(se[e]){var n=se[e].indexOf(t);n>=0&&se[e].splice(n,1)}},open:function(e){if(!fe("subwindowOpen"))throw f($,"No permission for liff.subWindow.open()");if(!Sr()&&_r())throw f($,"Subwindow is not supported in this browser");return function(){if(le())throw f(G,"this api can be only called in parent window")}(),y()?Ri(e):Di(e)},cancel:function(e){return e===void 0&&(e={}),He(),y()?function(t){return t===void 0&&(t={}),h(this,void 0,void 0,function(){var n,r;return p(this,function(i){switch(i.label){case 0:return(n=Ie())?[4,Pt({mst:n,status:C.CANCEL,result:t})]:[2,Promise.reject(f(G,"mst is invalid"))];case 1:return r=i.sent(),de(!0),[2,r]}})})}(e):function(t){return t===void 0&&(t={}),Dn(C.CANCEL,t)}(e)},submit:function(e){return e===void 0&&(e={}),He(),y()?function(t){return t===void 0&&(t={}),h(this,void 0,void 0,function(){var n,r;return p(this,function(i){switch(i.label){case 0:return(n=Ie())?[4,Pt({mst:n,status:C.SUBMIT,result:t})]:[2,Promise.reject(f(G,"mst is invalid"))];case 1:return r=i.sent(),de(!0),[2,r]}})})}(e):function(t){return t===void 0&&(t={}),Dn(C.SUBMIT,t)}(e)},close:function(){return He(),y()?function(){return h(this,void 0,void 0,function(){var e;return p(this,function(t){switch(t.label){case 0:return We()!==!1?[3,2]:(e=Ie())?[4,Pt({mst:e,status:C.CLOSE,result:{}})]:[2,Promise.reject(f(G,"mst is invalid"))];case 1:t.sent(),t.label=2;case 2:return Te(),[2]}})})}():function(){return h(this,void 0,void 0,function(){var e;return p(this,function(t){return(e=he())!=null&&e.isReady()?(e.send({eventName:C.CLOSE}),[2,new Promise(function(n){setTimeout(function(){Te(),n()},Er)})]):(Te(),[2,Promise.resolve()])})})}()},getAppData:function(){return He(),function(){var e,t=Zt();try{e=t?JSON.parse(t):{}}catch{e={}}return Promise.resolve(e)}()}};const Wi=Object.freeze(Object.defineProperty({__proto__:null,getAppData:Hn,getMSTByMSIT:Vn,getMainWindowOrigin:It,getMessageBus:he,initMessageBus:_t,setMainWindowOrigin:Un,subWindow:q},Symbol.toStringTag,{value:"Module"}));var Vi=function(){var e=this;this.type="sync",this.fns=new Set,this.on=function(t){e.fns.add(t)},this.call=function(){for(var t,n,r=[],i=0;i0&&!t.startsWith("/")?"/":"").concat(t)},e.prototype.invoke=function(){return h(this,void 0,void 0,function(){var t,n,r,i,s;return p(this,function(o){switch(o.label){case 0:if(t=W.parse(window.location.search),typeof(n=t["liff.state"])!="string")return[2];o.label=1;case 1:return o.trys.push([1,4,,5]),r=location.href,(i=this.decodeState(n))===r?[3,3]:(t["liff.hback"]?location.replace(xr(i,{"liff.hback":t["liff.hback"]})):location.replace(i),[4,new Promise(function(){})]);case 2:o.sent(),o.label=3;case 3:return[3,5];case 4:if((s=o.sent()).code===M)throw s;return E.debug(s),[3,5];case 5:return[2]}})})},e}());function ro(e,t,n){return h(this,void 0,void 0,function(){var r;return p(this,function(i){switch(i.label){case 0:if(!t.liffId)throw f(ne,"liffId is necessary for liff.init()");return Xt(t),!y()&&J()&&(fn()||_n()),r=W.parse(window.location.search),!le()||y()?[3,2]:[4,$n()];case 1:i.sent(),i.label=2;case 2:if(r.error&&r.liffOAuth2Error)throw c=r.error,a=r.error_description,u=a.replace(/\+/g," "),l="".concat(c,": ").concat(u),f(M,l);return s=r.code,o=at(),Boolean(s&&!J()&&o&&o.codeVerifier)?[4,to(r.liffClientId)]:[3,4];case 3:i.sent(),i.label=4;case 4:return y()?[4,Zi(e,t)]:[3,6];case 5:return i.sent(),[3,8];case 6:return J()?[3,8]:[4,Xn()];case 7:i.sent(),i.label=8;case 8:return[4,no.invoke()];case 9:return i.sent(),[4,n()];case 10:return i.sent(),Ks(window.location.href),[2]}var s,o,c,a,u,l})})}var Qn=function(e,t){return new Promise(function(n,r){if(e){var i=document.createElement("script");i.type="module",i.onload=function(){n()},i.src=e,document.head.appendChild(i)}else r(f(ne,t))})},io=function(e){var t="https://static.line-scdn.net/lui/edge/versions/1.13.0/lui-alert.js";return t&&e&&(t=t.replace(/\d{1,2}\.\d{1,2}\.\d{1,3}/,e)),Qn(t,"LUI_ALERT_URL is not defined")},Lt=function(){return h(void 0,void 0,void 0,function(){var e;return p(this,function(t){switch(t.label){case 0:return e=function(){var r,i=document.querySelector('script[src*="luivendor.js"]');if(i&&((r=i.src.match(/\d{1,2}\.\d{1,2}\.\d{1,3}/g))===null||r===void 0?void 0:r.length))return i.src.match(/\d{1,2}\.\d{1,2}\.\d{1,3}/g)[0]}(),e?[3,2]:[4,Qn("https://static.line-scdn.net/lui/edge/versions/1.13.0/luivendor.js","LUI_VENDOR_URL is not defined")];case 1:t.sent(),t.label=2;case 2:return[4,io(e)];case 3:return t.sent(),[4,(n=Se(6),new Promise(function(){var r=document.createElement("div");r.innerHTML=''),document.body.appendChild(r);var i=document.getElementById("".concat("liffAlert","-").concat(n));i&&i.addEventListener("lui-button-click",function(){var s=window.open("".concat(window.location.href,"&liffIsEscapedFromApp=true"),"_blank");s&&(s.location.href="".concat(window.location.href,"&liffIsEscapedFromApp=true"),window.close())})}))];case 4:return t.sent(),[2]}var n})})};function oo(){return h(this,void 0,void 0,function(){var e;return p(this,function(t){switch(t.label){case 0:return y()||Q()!=="android"||(e=W.parse(window.location.search))[Cn]||e.liffIsEscapedFromApp?[3,6]:e.liffClientId&&document.referrer.includes("access.".concat("line.me"))?(window.location.href="".concat(window.location.href,"&liffIsEscapedFromApp=true"),[2]):e.liffClientId&&document.referrer.includes("android-app://")?[4,Lt()]:[3,2];case 1:t.sent(),t.label=2;case 2:return e.liffClientId&&document.referrer===""&&window.history.length===1?[4,Lt()]:[3,4];case 3:t.sent(),t.label=4;case 4:return!document.referrer.includes("liffClientId")||document.referrer.includes("liffIsEscapedFromApp")?[3,6]:[4,Lt()];case 5:t.sent(),t.label=6;case 6:return[2]}})})}var so=function(){function e(){this.hooks={before:new xe,after:new xe},this.internalHooks={beforeFinished:new xe,beforeSuccess:new xe,error:new xe}}return Object.defineProperty(e.prototype,"name",{get:function(){return"init"},enumerable:!1,configurable:!0}),e.prototype.install=function(t){var n=t.liff;return this.liff=n,this.init.bind(this)},e.prototype.init=function(t,n,r){return h(this,void 0,void 0,function(){var i;return p(this,function(s){switch(s.label){case 0:return[4,this.hooks.before.call()];case 1:s.sent(),o=this.liff,window&&!window.liff&&(window.liff=o),s.label=2;case 2:return s.trys.push([2,9,,11]),[4,Promise.all([zi(this.liff),ro(this.liff,t,this.internalHooks.beforeFinished.call)])];case 3:return s.sent(),Hi(),[4,this.internalHooks.beforeSuccess.call()];case 4:return s.sent(),!t.withLoginOnExternalBrowser||J()?[3,6]:(this.liff.login(),[4,new Promise(function(){})]);case 5:s.sent(),s.label=6;case 6:return[4,oo()];case 7:return s.sent(),[4,this.hooks.after.call()];case 8:return s.sent(),typeof n=="function"&&n(),mt(),[3,11];case 9:return i=s.sent(),[4,this.internalHooks.error.call(i)];case 10:throw s.sent(),typeof r=="function"&&r(i),i;case 11:return[2]}var o})})},e}();const ao=Object.freeze(Object.defineProperty({__proto__:null,InitModule:so},Symbol.toStringTag,{value:"Module"})),co=I(ao),uo=I(Oi),lo=I(Mr),fo=I(Rr),ho=I(Ei);var Yn={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.sha256=n()})(Fs,function(){var t=function n(r){function i(Xe,ue){return Xe>>>ue|Xe<<32-ue}for(var s=Math.pow,o=s(2,32),c="length",a,u,l="",d=[],m=r[c]*8,v=n.h=n.h||[],g=n.k=n.k||[],S=g[c],_={},w=2;S<64;w++)if(!_[w]){for(a=0;a<313;a+=w)_[a]=w;v[S]=s(w,.5)*o|0,g[S++]=s(w,.3333333333333333)*o|0}for(r+="\x80";r[c]%64-56;)r+="\0";for(a=0;a>8)return;d[a>>2]|=u<<(3-a)%4*8}for(d[d[c]]=m/o|0,d[d[c]]=m,u=0;u>>3)+T[a-7]+(i(ee,17)^i(ee,19)^ee>>>10)|0),Nt=(i(te,2)^i(te,13)^i(te,22))+(te&v[1]^te&v[2]^v[1]&v[2]);v=[Je+Nt|0].concat(v),v[4]=v[4]+Je|0}for(a=0;a<8;a++)v[a]=v[a]+X[a]|0}for(a=0;a<8;a++)for(u=3;u+1;u--){var qe=v[a]>>u*8&255;l+=(qe<16?0:"")+qe.toString(16)}return l};return t.code='var sha256=function a(b){function c(a,b){return a>>>b|a<<32-b}for(var d,e,f=Math.pow,g=f(2,32),h="length",i="",j=[],k=8*b[h],l=a.h=a.h||[],m=a.k=a.k||[],n=m[h],o={},p=2;64>n;p++)if(!o[p]){for(d=0;313>d;d+=p)o[d]=p;l[n]=f(p,.5)*g|0,m[n++]=f(p,1/3)*g|0}for(b+="\\x80";b[h]%64-56;)b+="\\x00";for(d=0;d>8)return;j[d>>2]|=e<<(3-d)%4*8}for(j[j[h]]=k/g|0,j[j[h]]=k,e=0;ed;d++){var s=q[d-15],t=q[d-2],u=l[0],v=l[4],w=l[7]+(c(v,6)^c(v,11)^c(v,25))+(v&l[5]^~v&l[6])+m[d]+(q[d]=16>d?q[d]:q[d-16]+(c(s,7)^c(s,18)^s>>>3)+q[d-7]+(c(t,17)^c(t,19)^t>>>10)|0),x=(c(u,2)^c(u,13)^c(u,22))+(u&l[1]^u&l[2]^l[1]&l[2]);l=[w+x|0].concat(l),l[4]=l[4]+w|0}for(d=0;8>d;d++)l[d]=l[d]+r[d]|0}for(d=0;8>d;d++)for(e=3;e+1;e--){var y=l[d]>>8*e&255;i+=(16>y?0:"")+y.toString(16)}return i};',t})})(Yn);const po=Yn.exports;var vo=function(){function e(){this.hooks={before:new Vi}}return Object.defineProperty(e.prototype,"name",{get:function(){return"login"},enumerable:!1,configurable:!0}),e.prototype.install=function(){return this.login.bind(this)},e.prototype.login=function(t){var n;this.hooks.before.call(t);var r=Se(43),i=Js(po(r)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),s=O();if(!s||!s.liffId)throw f(ne,"You need to define `liffId` for liff.login()");var o={app_id:s.liffId,state:Se(12),response_type:"code",code_challenge_method:"S256",code_challenge:i,liff_sdk_version:ft()};t&&t.redirectUri&&(o.redirect_uri=t.redirectUri),le()&&!y()&&(!((n=he())===null||n===void 0)&&n.isReady()?o.redirect_uri=window.location.href:o.disable_auto_login="true"),un({codeVerifier:r});var c=P("authorize")+"?"+W.stringify(o);E.debug("[Redirect] ".concat(c)),window.location.href=c},e}();const mo=Object.freeze(Object.defineProperty({__proto__:null,LoginModule:vo},Symbol.toStringTag,{value:"Module"})),go=I(mo),wo=I(Ii),bo=I(ei);var yo=function(e,t){return e?"&".concat(e.split("&").filter(function(n){return n.indexOf("is_liff_external_open_window")===-1}).join("&").concat("".concat(t?"#".concat(t):""))):"".concat(t?"#".concat(t):"")};function So(e){if(!function(s){if(!s||typeof s!="object")return!1;var o=s,c=o.url,a=o.external,u=V([typeof c,typeof a],2),l=u[0],d=u[1];return l==="string"&&c!==""&&(d==="undefined"||d==="boolean")}(e))throw f(j,"Invalid parameters for liff.openWindow()");var t=ie();if(y())if(t!==null&&Q()==="ios"&&re(t,"9.19")>=0||!window._liff.postMessage){var n=e.url,r=e.external,i=r!==void 0&&r;window.open(function(s,o){var c,a,u,l,d,m,v,g,S;(function(w){return w.indexOf("#")!==-1&&w.indexOf("?")!==-1&&w.indexOf("#")0&&u[0]!=="/"&&(u="/"+u);var l=new RegExp("^".concat(Xs.join("|"))),d=o.substring(1).split("&").filter(function(ee){return!l.test(ee)&&Boolean(ee)}).join("&"),m=d===a.hash.substring(1)?"":d,v=function(ee){return ee.substring(1).split("&").filter(function(te){return!/liff\.state/.test(te)&&Boolean(te)})},g=v(s),S=v(a.search);t.extraParams&&g.push(t.extraParams);for(var _=0;_-1&&g.splice(T,1)}var X=g.join("&"),K="".concat(u).concat(X!==""?"?".concat(X):"").concat(m?"#".concat(m):"");return"".concat(qs).concat(O().liffId).concat(K)},this.createUrlBy=function(n){return h(t,void 0,void 0,function(){var r,i;return p(this,function(s){switch(s.label){case 0:if(!(r=O().liffId))throw f(M,"Should run after liff init.");try{i=new URL(n)}catch{throw f(j,"invalid URL.")}return[4,To({liffId:r,currentPageUrl:i.toString()})];case 1:return[2,s.sent().permanentLinkUrl]}})})},this.setExtraQueryParam=function(n){t.extraParams=n},this.isAncestor=function(n,r){return r.indexOf(n)===0&&(n.endsWith("/")&&(n=n.substring(0,n.length-1)),r[n.length]===void 0||r[n.length]==="/")},this.install=function(){return{createUrl:t.createUrl,createUrlBy:t.createUrlBy,setExtraQueryParam:t.setExtraQueryParam}}}return Object.defineProperty(e.prototype,"name",{get:function(){return"permanentLink"},enumerable:!1,configurable:!0}),e}(),Co=new Zn;const Eo=Object.freeze(Object.defineProperty({__proto__:null,PermanentLink:Zn,module:Co},Symbol.toStringTag,{value:"Module"})),Po=I(Eo);function er(e){return h(this,void 0,void 0,function(){var t,n,r,i,s,o,c;return p(this,function(a){switch(a.label){case 0:return function(u){if(!$s.includes(u))throw f(j,"Unexpected permission name.");var l=N();return!!(l!=null&&l.scope.includes(u))}(e)?(t=oe())?[4,vn(t)]:[3,2]:[2,{state:"unavailable"}];case 1:n=a.sent(),r=unescape(n.scope).split(" ");try{for(i=zt(r),s=i.next();!s.done;s=i.next())if(s.value.includes(e))return[2,{state:"granted"}]}catch(u){o={error:u}}finally{try{s&&!s.done&&(c=i.return)&&c.call(i)}finally{if(o)throw o.error}}return[2,{state:"prompt"}];case 2:throw f(G,"LiffId is not found.")}})})}function tr(){var e,t,n=N();return!!n&&n.type!=="square_chat"&&(fe("skipChannelVerificationScreen")||!y()&&((t=(e=n.availability)===null||e===void 0?void 0:e.skipChannelVerificationScreen)===null||t===void 0?void 0:t.permission))}function ko(){var e=O().liffId;if(e)return F("".concat(P("unauthorizedPermissions"),"?liffId=").concat(e),{headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer ".concat(oe())}});throw f(G,"liffId is required")}var ze,Ke=q.on,Ge=q.off,Oo=q.open,xo=function(){function e(t,n){var r=this;this.onSubmit=function(i){var s=i.newAccessToken,o=i.ICA_ERROR;return h(r,void 0,void 0,function(){return p(this,function(c){return s?this.resolve({newAccessToken:s}):o&&this.reject(f(R,o)),this.teardown(),[2]})})},this.onClose=function(){return h(r,void 0,void 0,function(){return p(this,function(i){return this.reject(f(G,"user didn't allow the agreement")),this.teardown(),[2]})})},this.onCancel=function(){return h(r,void 0,void 0,function(){return p(this,function(i){return this.reject(f(G,"user didn't allow the agreement")),this.teardown(),[2]})})},this.onError=function(i){return h(r,void 0,void 0,function(){return p(this,function(s){return this.reject(i),this.teardown(),[2]})})},this.resolve=t,this.reject=n,this.setup()}return e.prototype.setup=function(){Ke("submit",this.onSubmit),Ke("close",this.onClose),Ke("cancel",this.onCancel),Ke("error",this.onError)},e.prototype.teardown=function(){Ge("submit",this.onSubmit),Ge("close",this.onClose),Ge("cancel",this.onCancel),Ge("error",this.onError),ze=void 0},e.prototype.open=function(){var t=O().liffId;t?Oo({url:"".concat("https://liff.line.me/1656032314-Xgrw5Pmk"),appData:{liffId:t,channelId:Gt(t),accessToken:oe()}}):this.reject(f(G,"liffId is required"))},e}();function nr(){return h(this,void 0,void 0,function(){var e,t;return p(this,function(n){switch(n.label){case 0:if(!tr())throw f($,"SkipChannelVerificationScreen is unavailable.");return ze&&ze.teardown(),[4,ko()];case 1:return e=n.sent(),(y()?e:e.filter(function(r){return r!=="chat_message.write"})).length>0?[4,new Promise(function(r,i){(ze=new xo(r,i)).open()})]:[3,3];case 2:return t=n.sent().newAccessToken,Fe(t),[3,4];case 3:throw f($,"All permissions have already been approved.");case 4:return[2]}})})}function Ao(e,t){var n=this;return function(){for(var r=[],i=0;i0?r[r.length-1]:{}).ignorePermissionCheck,o=s!==void 0&&s,[4,er(t)];case 1:if((c=a.sent().state)!=="unavailable")return[3,2];throw f($,"The permission is not in LIFF app scope.");case 2:return c!=="prompt"||!tr()||o||!y()&&t==="chat_message.write"?[3,4]:[4,nr()];case 3:return a.sent(),[3,5];case 4:o&&r.pop(),a.label=5;case 5:return[4,e.apply(void 0,Ze([],V(r),!1))];case 6:return[2,a.sent()]}})})}}var rr=function(){function e(){this.name="permission"}return e.prototype.install=function(){return{query:er,requestAll:nr}},e}(),Lo=new rr;const jo=Object.freeze(Object.defineProperty({__proto__:null,PermissionModule:rr,attachChecker:Ao,module:Lo},Symbol.toStringTag,{value:"Module"})),Mo=I(jo),Fo=I(wi);var pe,Uo=function(){function e(t,n){var r=this;this.resolve=t,this.reject=n,this.onSubmit=function(i){var s=i.message;r.resolve({value:s}),r.destroy()},this.onClose=function(){r.resolve({value:null}),r.destroy()},this.onCancel=function(){r.resolve({value:null}),r.destroy()},this.onError=function(i){r.reject(i),r.destroy()},this.start()}return e.prototype.start=function(){q.on("submit",this.onSubmit),q.on("close",this.onClose),q.on("cancel",this.onCancel),q.on("error",this.onError)},e.prototype.destroy=function(){q.off("submit",this.onSubmit),q.off("close",this.onClose),q.off("cancel",this.onCancel),q.off("error",this.onError),pe=void 0},e}();function Do(){return h(this,void 0,void 0,function(){return p(this,function(e){if(!fe("subwindowOpen")||!fe("scanCodeV2"))throw f($,"No permission for liff.scanCodeV2()");return pe&&pe.destroy(),[2,new Promise(function(t,n){pe=new Uo(t,n),q.open({url:"https://liff.line.me/1656359117-jxmx5e11"}).catch(function(r){pe==null||pe.destroy(),n(r)})})]})})}var ir=function(){function e(){}return Object.defineProperty(e.prototype,"name",{get:function(){return"scanCodeV2"},enumerable:!1,configurable:!0}),e.prototype.install=function(){return Do},e}(),Bo=new ir;const No=Object.freeze(Object.defineProperty({__proto__:null,ScanCodeV2Module:ir,module:Bo},Symbol.toStringTag,{value:"Module"})),Ro=I(No);var Wo=function(e){return typeof e=="object"&&e!==null&&function(t){return typeof t=="string"||t instanceof String}(e.type)};function or(e){return Promise.reject(f(j,e))}function Vo(e){if(!function(n){return Array.isArray(n)&&n.every(Wo)}(e))return or("Parameter 'messages' must be an array of { type, ... }");var t=e.length;return t<1||t>5?or("Number of messages should be in range 1 to ".concat(5,".")):F(P("message"),{method:"POST",body:JSON.stringify({messages:e})}).catch(sr)}var sr=function(e){if(e.code==="403"){var t=ie()==="12.0.0",n=Q()==="ios",r=Ht();t&&(n||r)&&window.alert(`LINE\u30A2\u30D7\u30EA\u3092LINE 12.0.1\u4EE5\u964D\u306B\u30A2\u30C3\u30D7\u30C7\u30FC\u30C8\u3057\u3066\u304F\u3060\u3055\u3044\u3002 Please update your LINE app to LINE 12.0.1 or later.`)}throw e};const Ho=Object.freeze(Object.defineProperty({__proto__:null,alertToPromptUpdate:sr,sendMessages:Vo},Symbol.toStringTag,{value:"Module"})),zo=I(Ho);var ar={};function Ko(){return ar}function cr(e,t){var n=Ko(),r=V(t.split("."),1)[0],i=n[t];i&&e.removeEventListener(r,i),n[t]=null}var ur=!1,lr=!1;function Go(e,t,n,r){ur||(lr=function(){var s=!1;try{var o=Object.defineProperty({},"passive",{get:function(){return s=!0,!1}});window.addEventListener("test",o,o),window.removeEventListener("test",o,o)}catch{s=!1}return s}(),ur=!0);var i=V(t.split("."),1)[0];return new Promise(function(s){var o=function(c){s(c),n&&n(c),r&&r.once&&cr(e,t)};(function(c,a){ar[c]=a})(t,o),e.addEventListener(i,o,!!lr&&r)})}function fr(e,t,n,r){if(n===void 0&&(n={}),typeof e!="object"||!e.postMessage)throw f(j,"target must be window object");if(typeof t!="string")throw f(j,"keyname must be string");if(typeof n!="object")throw f(j,"incorrect body format. It should be Object or Array comprised of Object");if(!r)throw f(j,"serverEndPointUrl isn't passed. please fill up with proper url");if(r==="*")throw new Error("serverEndPointUrl doesn't allow to set '*'");var i={name:t,body:n};e.postMessage(i,r)}function Jo(e,t,n,r){Go(e,"message.".concat(t),function(i,s,o){return function(c){E.debug("messageReceive",c),c.origin===o&&c.data.name===i&&s(c)}}(t,n,r))}var qo=function(){function e(){this.payloadToShareTargetPicker=null,this.popupWindow=null,this.doesWaitForSubwindowResult=!1}return e.getInstance=function(){return e.instance?e.instance.reset():e.instance=new e,e.instance},e.prototype.init=function(t){return h(this,void 0,void 0,function(){var n,r;return p(this,function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),this.liffId=t.referrer.liffId,this.doesWaitForSubwindowResult=!(!t.options||!t.options.waitForSubwindowResult),this.allowPostMessageOrigin=this.initAllowPostMessageOrigin(),this.payloadToShareTargetPicker=this.buildPayloadToShareTargetPicker(t),window.AbortController&&(this.abortController=new window.AbortController),this.prepareAnotherWindow(),[4,this.initOtt()];case 1:return i.sent(),this.initListener(),this.openAnotherWindow(),this.doesWaitForSubwindowResult?[4,this.pollingShareResult()]:[3,3];case 2:return n=i.sent(),this.finalize(),[2,n];case 3:case 6:return[2];case 4:return[3,6];case 5:if(r=i.sent(),this.finalize(),r.name!=="AbortError")throw r;return[3,6]}})})},e.prototype.resetAllVariables=function(){this.liffId="",this.allowPostMessageOrigin="",this.payloadToShareTargetPicker=null,this.ott="",this.popupWindow=null,this.timeoutIDForHealthCheck=null,this.abortController=null,this.internalError=null,this.doesWaitForSubwindowResult=!1},e.prototype.reset=function(){this.finalize(),this.resetAllVariables()},e.prototype.finalize=function(){var t,n;this.abortController&&this.abortController.abort(),y()||(t=this.timeoutIDForHealthCheck,n=this.popupWindow,cr(window,"message.receivedHealthcheck"),t&&clearTimeout(t),n&&!n.closed&&n.close())},e.prototype.buildPayloadToShareTargetPicker=function(t){return{messages:t.messages,isMultiple:t.isMultiple,referrer:t.referrer}},e.prototype.initAllowPostMessageOrigin=function(t){return t===void 0&&(t=P("shareTargetPicker")),Zs(t)},e.prototype.initOtt=function(){return h(this,void 0,void 0,function(){var t,n,r;return p(this,function(i){switch(i.label){case 0:return this.abortController&&(t=this.abortController.signal),n="".concat(P("shareTargetPickerOtt"),"/").concat(this.liffId,"/ott"),r=this,[4,F(n,{method:"GET",signal:t}).then(function(s){return s.ott})];case 1:return r.ott=i.sent(),[2]}})})},e.prototype.prepareAnotherWindow=function(){y()||(Q()!=="ios"||Ht()?this.popupWindow=window.open("","liffpopup","width=480, height=640, menubar=no, toolbar=no, scrollbars=yes"):this.popupWindow=window.open())},e.prototype.openAnotherWindow=function(){if(y()&&this.payloadToShareTargetPicker)t=this.liffId,n=this.ott,r=this.payloadToShareTargetPicker,i={liffId:t,ott:n,data:JSON.stringify(r),closeModals:!1},location.href="".concat("line://picker","?").concat(W.stringify(i));else{if(this.timeoutIDForHealthCheck=window.setTimeout(this.healthCheck.bind(this),1e3),!this.popupWindow)throw f(Vt);(function(s,o,c){var a={liffId:o,ott:c};s.location.href="".concat(P("shareTargetPicker"),"?").concat(W.stringify(a))})(this.popupWindow,this.liffId,this.ott)}var t,n,r,i},e.prototype.initListener=function(){var t,n;y()||(t=this.onReceivedHealthcheck.bind(this),n=this.allowPostMessageOrigin,Jo(window,"receivedHealthcheck",t,n))},e.prototype.healthCheck=function(){return h(this,void 0,void 0,function(){var t;return p(this,function(n){switch(n.label){case 0:if(this.popupWindow&&!this.popupWindow.closed)return[3,7];if(!this.doesWaitForSubwindowResult)return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.onCanceled()];case 2:return n.sent(),[3,4];case 3:return t=n.sent(),this.internalError=t,[3,4];case 4:return[3,6];case 5:this.finalize(),n.label=6;case 6:return[3,8];case 7:r=this.popupWindow,i=this.allowPostMessageOrigin,fr(r,"healthcheck",void 0,i),this.timeoutIDForHealthCheck=window.setTimeout(this.healthCheck.bind(this),1e3),n.label=8;case 8:return[2]}var r,i})})},e.prototype.onReceivedHealthcheck=function(){if(!this.popupWindow||!this.payloadToShareTargetPicker)throw f(Vt);var t,n,r;t=this.popupWindow,n=this.payloadToShareTargetPicker,r=this.allowPostMessageOrigin,fr(t,"ready",n,r)},e.prototype.onCanceled=function(){return h(this,void 0,void 0,function(){var t,n;return p(this,function(r){switch(r.label){case 0:if(y()||!this.ott)throw new Error("need to call with ott in client");return this.abortController&&(t=this.abortController.signal),n={liffId:this.liffId,ott:this.ott},[4,F("".concat(P("shareTargetPickerResult"),"?").concat(W.stringify(n)),{method:"POST",signal:t,headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:"result=CANCEL"})];case 1:return[2,r.sent().status==="ok"]}})})},e.prototype.getShareResult=function(){return h(this,void 0,void 0,function(){var t,n;return p(this,function(r){if(!this.ott)throw new Error("need to call with ott in client");return this.abortController&&(t=this.abortController.signal),n={liffId:this.liffId,ott:this.ott},E.debug("fetch: getShareResult"),[2,F("".concat(P("shareTargetPickerResult"),"?").concat(W.stringify(n)),{method:"GET",headers:{Accept:"application/json"},signal:t})]})})},e.isPollingTimeOut=function(t,n){return(n-t)/6e4>=10},e.prototype.pollingShareResult=function(){return h(this,void 0,void 0,function(){var t,n;return p(this,function(r){switch(r.label){case 0:t=Date.now(),r.label=1;case 1:if(e.isPollingTimeOut(t,Date.now()))return[3,4];if(this.internalError)throw this.internalError;return[4,this.getShareResult()];case 2:if((n=r.sent())&&n.result)switch(n.result){case"SUCCESS":return[2,{status:"success"}];case"CANCEL":return[2];default:throw new Error(n.resultDescription)}return[4,new Promise(function(i){setTimeout(i,500)})];case 3:return r.sent(),[3,1];case 4:throw new Error("Timeout: not finished within ".concat(10,"min"))}})})},e}(),dr=function(){function e(){var t=this;this.name="shareTargetPicker",this.shareTargetPicker=function(n,r){return r===void 0&&(r={}),h(t,void 0,void 0,function(){var i,s,o,c,a,u,l;return p(this,function(d){switch(d.label){case 0:if(i=r.isMultiple===void 0||r.isMultiple,this.checkPermission(),!J())throw f(G,"Need access_token for api call, Please login first");if(!n||!Array.isArray(n)||n.length===0)throw f(j,"no proper argument");if(n.length>Ys)throw f(j,"exceed the limit of num of messages");if(!(s=O().liffId))throw f(ne);window.liff&&(o=window.liff).analytics&&gn(o.analytics),d.label=1;case 1:return d.trys.push([1,3,,4]),c=qo.getInstance(),a=ie(),u={waitForSubwindowResult:!0},y()&&a&&re(a,"10.11.0")<0&&(u.waitForSubwindowResult=!1),[4,c.init({messages:n,isMultiple:i,referrer:{liffId:s,url:location.origin},options:u})];case 2:return[2,d.sent()];case 3:throw(l=d.sent())instanceof Qs?l:f(Wt,l.message);case 4:return[2]}})})},this.checkPermission=function(){if(le())throw f($,"The operation is not allowed in the SubWindow");var n=((N()||{}).availability||{}).shareTargetPicker||{},r=n.permission,i=n.minVer;if(!r)throw y()?f($,"Need LINE App ".concat(i," at least or consent on shareTargetPicker usage on LINE developer site")):f($,"Need consent on shareTargetPicker usage on LINE developer site")}}return e.prototype.install=function(){return this.shareTargetPicker},e}(),Xo=new dr;const $o=Object.freeze(Object.defineProperty({__proto__:null,ShareTargetPickerModule:dr,module:Xo},Symbol.toStringTag,{value:"Module"})),Qo=I($o),Yo=I(Br),Zo=I(Wi);var es=function(e,t){this._driver=e,this.liff=t,this.hooks=this._driver.hooks,this.internalHooks=this._driver.internalHooks},ts=function(e,t){this._driver=e,this.liff=t,this.hooks=this._driver.hooks},ns=function(){function e(){this.modules=new Map,this.hooks={},this.internalHooks={}}return e.prototype.addModule=function(t,n){this.modules.set(t,n),n.hooks&&(this.hooks[t]=Object.entries(n.hooks).reduce(function(r,i){var s,o=V(i,2),c=o[0],a=o[1];return x(x({},r),((s={})[c]=a.on.bind(a),s))},{})),n.internalHooks&&(this.internalHooks[t]=Object.entries(n.internalHooks).reduce(function(r,i){var s,o=V(i,2),c=o[0],a=o[1];return x(x({},r),((s={})[c]=a.on.bind(a),s))},{}))},e.prototype.hasModule=function(t){return this.modules.has(t)},e}(),rs=function(){function e(t,n,r){this.driver=t,this.context=n,this.option=r}return e.prototype.install=function(){return this.factory(this.driver,this.context)},Object.defineProperty(e.prototype,"name",{get:function(){return"use"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOption",{get:function(){return{namespacePrefix:"$"}},enumerable:!1,configurable:!0}),e.prototype.factory=function(t,n){var r=Object.assign({},this.defaultOption,this.option).namespacePrefix;return function(i,s){if(!i||typeof i.install!="function"||typeof i.name!="string")return E.warn("To install the plugin, you need to define the `name` property and the `install` method."),this;var o="".concat(r).concat(i.name);if(t.hasModule(o))return this;var c=i.install.call(i,n,s);return this["".concat(o)]?(E.warn("There is a duplicate plugin name. `".concat(o,"` plugin namespace will be override.")),this["".concat(o)]=c):c!==void 0&&(this["".concat(o)]=c),t.addModule(o,i),this}},e}();const is=Object.freeze(Object.defineProperty({__proto__:null,LiffPluginContextImpl:ts,ModuleContextImpl:es,ModuleDriverImpl:ns,UseModule:rs},Symbol.toStringTag,{value:"Module"})),os=I(is);function hr(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})}function pr(e){var t=this;return new t(function(n,r){if(!(e&&typeof e.length<"u"))return r(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(e);if(i.length===0)return n([]);var s=i.length;function o(a,u){if(u&&(typeof u=="object"||typeof u=="function")){var l=u.then;if(typeof l=="function"){l.call(u,function(d){o(a,d)},function(d){i[a]={status:"rejected",reason:d},--s===0&&n(i)});return}}i[a]={status:"fulfilled",value:u},--s===0&&n(i)}for(var c=0;c-1};function Le(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Ft(e){return typeof e!="string"&&(e=String(e)),e}function Ut(e){var t={next:function(){var n=e.shift();return{done:n===void 0,value:n}}};return z.iterable&&(t[Symbol.iterator]=function(){return t}),t}function L(e){this.map={},e instanceof L?e.forEach(function(t,n){this.append(n,t)},this):Array.isArray(e)?e.forEach(function(t){this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}L.prototype.append=function(e,t){e=Le(e),t=Ft(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},L.prototype.delete=function(e){delete this.map[Le(e)]},L.prototype.get=function(e){return e=Le(e),this.has(e)?this.map[e]:null},L.prototype.has=function(e){return this.map.hasOwnProperty(Le(e))},L.prototype.set=function(e,t){this.map[Le(e)]=Ft(t)},L.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},L.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),Ut(e)},L.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),Ut(e)},L.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),Ut(e)},z.iterable&&(L.prototype[Symbol.iterator]=L.prototype.entries);function Dt(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function wr(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function vs(e){var t=new FileReader,n=wr(t);return t.readAsArrayBuffer(e),n}function ms(e){var t=new FileReader,n=wr(t);return t.readAsText(e),n}function gs(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?t:e}function ae(e,t){if(!(this instanceof ae))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var n=t.body;if(e instanceof ae){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new L(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&e._bodyInit!=null&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new L(t.headers)),this.method=bs(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}ae.prototype.clone=function(){return new ae(this,{body:this._bodyInit})};function ys(e){var t=new FormData;return e.trim().split("&").forEach(function(n){if(n){var r=n.split("="),i=r.shift().replace(/\+/g," "),s=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(s))}}),t}function Ss(e){var t=new L,n=e.replace(/\r?\n[\t ]+/g," ");return n.split("\r").map(function(r){return r.indexOf(` `)===0?r.substr(1,r.length):r}).forEach(function(r){var i=r.split(":"),s=i.shift().trim();if(s){var o=i.join(":").trim();t.append(s,o)}}),t}yr.call(ae.prototype);function Y(e,t){if(!(this instanceof Y))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new L(t.headers),this.url=t.url||"",this._initBody(e)}yr.call(Y.prototype),Y.prototype.clone=function(){return new Y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new L(this.headers),url:this.url})},Y.error=function(){var e=new Y(null,{status:0,statusText:""});return e.type="error",e};var _s=[301,302,303,307,308];Y.redirect=function(e,t){if(_s.indexOf(t)===-1)throw new RangeError("Invalid status code");return new Y(null,{status:t,headers:{location:e}})};var ce=D.DOMException;try{new ce}catch{ce=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},ce.prototype=Object.create(Error.prototype),ce.prototype.constructor=ce}function Bt(e,t){return new Promise(function(n,r){var i=new ae(e,t);if(i.signal&&i.signal.aborted)return r(new ce("Aborted","AbortError"));var s=new XMLHttpRequest;function o(){s.abort()}s.onload=function(){var a={status:s.status,statusText:s.statusText,headers:Ss(s.getAllResponseHeaders()||"")};a.url="responseURL"in s?s.responseURL:a.headers.get("X-Request-URL");var u="response"in s?s.response:s.responseText;setTimeout(function(){n(new Y(u,a))},0)},s.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},s.onabort=function(){setTimeout(function(){r(new ce("Aborted","AbortError"))},0)};function c(a){try{return a===""&&D.location.href?D.location.href:a}catch{return a}}s.open(i.method,c(i.url),!0),i.credentials==="include"?s.withCredentials=!0:i.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(z.blob?s.responseType="blob":z.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(s.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof L)?Object.getOwnPropertyNames(t.headers).forEach(function(a){s.setRequestHeader(a,Ft(t.headers[a]))}):i.headers.forEach(function(a,u){s.setRequestHeader(u,a)}),i.signal&&(i.signal.addEventListener("abort",o),s.onreadystatechange=function(){s.readyState===4&&i.signal.removeEventListener("abort",o)}),s.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}Bt.polyfill=!0,D.fetch||(D.fetch=Bt,D.Headers=L,D.Request=ae,D.Response=Y);const Is=Object.freeze(Object.defineProperty({__proto__:null,Headers:L,Request:ae,Response:Y,get DOMException(){return ce},fetch:Bt},Symbol.toStringTag,{value:"Module"})),Ts=I(Is);(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={550:(o,c,a)=>{Object.defineProperty(c,"__esModule",{value:!0});var u=a(628),l=a(453),d=a(208),m=a(464),v=a(881),g=a(309),S=a(273),_=a(635),w=a(525),T=a(947),X=a(0),K=a(243),ee=a(428),te=a(774),ve=a(958),Je=a(105),Nt=a(824),qe=a(626),Xe=a(312),ue=a(439),Cs=a(318),Es=a(437),Ps=a(741),ks=a(483),$e=a(54),Os=a(940),xs=a(764),Qe=Object.defineProperties({},{getOS:{value:g.getOS,enumerable:!0,writable:!0},getVersion:{value:S.getVersion,enumerable:!0,writable:!0},getLanguage:{value:_.getLanguage,enumerable:!0,writable:!0},isInClient:{value:m.isInClient,enumerable:!0,writable:!0},isLoggedIn:{value:T.isLoggedIn,enumerable:!0,writable:!0},logout:{value:X.logout,enumerable:!0,writable:!0},getAccessToken:{value:d.getAccessToken,enumerable:!0,writable:!0},getIDToken:{value:d.getIDToken,enumerable:!0,writable:!0},getDecodedIDToken:{value:d.getDecodedIDToken,enumerable:!0,writable:!0},getContext:{value:d.getContext,enumerable:!0,writable:!0},openWindow:{value:ve.openWindow,enumerable:!0,writable:!0},closeWindow:{value:Je.closeWindow,enumerable:!0,writable:!0},getFriendship:{value:(0,$e.attachChecker)(qe.getFriendship,"profile"),enumerable:!0,writable:!0},getAId:{value:d.getAId,enumerable:!0,writable:!0},getProfilePlus:{value:d.getProfilePlus,enumerable:!0,writable:!0},getIsVideoAutoPlay:{value:d.getIsVideoAutoPlay,enumerable:!0,writable:!0},getLineVersion:{value:ee.getLineVersion,enumerable:!0,writable:!0},isApiAvailable:{value:te.isApiAvailable,enumerable:!0,writable:!0},getProfile:{value:(0,$e.attachChecker)(w.getProfile,"profile"),enumerable:!0,writable:!0},sendMessages:{value:(0,$e.attachChecker)(Nt.sendMessages,"chat_message.write"),enumerable:!0,writable:!0},subWindow:{value:Xe.subWindow,enumerable:!0,writable:!0},ready:{value:v.ready,enumerable:!0,writable:!0},id:{get:function(){return(0,d.getConfig)().liffId||null},enumerable:!0},_dispatchEvent:{value:K.dispatch,enumerable:!0,writable:!0},_call:{value:K.call,enumerable:!0,writable:!0},_addListener:{value:K.addListener,enumerable:!0,writable:!0},_removeListener:{value:K.removeListener,enumerable:!0,writable:!0},_postMessage:{value:K.postMessage,enumerable:!0,writable:!0}}),Ye=new ue.ModuleDriverImpl,As=new ue.ModuleContextImpl(Ye,Qe),Ls=new ue.UseModule(Ye,As,{namespacePrefix:""}).install(),js=new ue.LiffPluginContextImpl(Ye,Qe);[new ue.UseModule(Ye,js),new l.LoginModule,new u.InitModule,new Cs.AnalyticsModule,ks.module,Es.module,Ps.module,$e.module,Os.module,xs.module].forEach(function(Ms){Ls.call(Qe,Ms)}),c.default=Qe},318:o=>{o.exports=Xr},105:o=>{o.exports=ni},626:o=>{o.exports=oi},635:o=>{o.exports=ci},428:o=>{o.exports=ui},309:o=>{o.exports=li},525:o=>{o.exports=fi},273:o=>{o.exports=di},764:o=>{o.exports=mi},628:o=>{o.exports=co},774:o=>{o.exports=uo},464:o=>{o.exports=lo},947:o=>{o.exports=fo},741:o=>{o.exports=ho},453:o=>{o.exports=go},0:o=>{o.exports=wo},243:o=>{o.exports=bo},958:o=>{o.exports=Io},437:o=>{o.exports=Po},54:o=>{o.exports=Mo},881:o=>{o.exports=Fo},483:o=>{o.exports=Ro},824:o=>{o.exports=zo},940:o=>{o.exports=Qo},208:o=>{o.exports=Yo},312:o=>{o.exports=Zo},439:o=>{o.exports=os},268:o=>{o.exports=fs},434:o=>{o.exports=Ts}},r={};function i(o){var c=r[o];if(c!==void 0)return c.exports;var a=r[o]={exports:{}};return n[o](a,a.exports,i),a.exports}var s={};return(()=>{var o=s;i(434),i(268);var c=i(550).default;o.default=c})(),s=s.default})())})(Jt),Lr=Us(Jt.exports)});export{ea as __tla,Lr as l};